[Bf-extensions-cvs] [3dbd6b5e] master: BlenderKit: report error in rare case where URL of file couldn't be obtained(reupload of asset with old search results still in blender)

Vilém Duha noreply at git.blender.org
Wed Aug 7 21:04:16 CEST 2019


Commit: 3dbd6b5eab9a342abe7b33ee25c168ae117c4863
Author: Vilém Duha
Date:   Wed Aug 7 20:40:13 2019 +0200
Branches: master
https://developer.blender.org/rBA3dbd6b5eab9a342abe7b33ee25c168ae117c4863

BlenderKit: report error in rare case where URL of file couldn't be obtained(reupload of asset with old search results still in blender)

===================================================================

M	blenderkit/download.py

===================================================================

diff --git a/blenderkit/download.py b/blenderkit/download.py
index ac43bc88..37b2c8e6 100644
--- a/blenderkit/download.py
+++ b/blenderkit/download.py
@@ -536,7 +536,12 @@ class Downloader(threading.Thread):
         api_key = self.api_key
 
         # TODO get real link here...
-        get_download_url(asset_data, scene_id, api_key, tcom=tcom)
+        has_url = get_download_url(asset_data, scene_id, api_key, tcom=tcom)
+
+        if not has_url:
+            tasks_queue.add_task(
+                (ui.add_report, ('Failed to obtain download URL for %s.' % asset_data['name'], 5, colors.RED)))
+            return;
         if tcom.error:
             return
         # only now we can check if the file already exists. This should have 2 levels, for materials and for brushes



More information about the Bf-extensions-cvs mailing list