Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'blenderkit/search.py')
-rw-r--r--blenderkit/search.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/blenderkit/search.py b/blenderkit/search.py
index cdde9523..87bf45da 100644
--- a/blenderkit/search.py
+++ b/blenderkit/search.py
@@ -110,9 +110,10 @@ def fetch_server_data():
len(user_preferences.api_key) < 38 and \
user_preferences.api_key_timeout < time.time() + 3600:
bkit_oauth.refresh_token_thread()
- if api_key != '':
+ if api_key != '' and bpy.context.window_manager.get('bkit profile') == None:
get_profile()
- categories.fetch_categories_thread(api_key)
+ if bpy.context.window_manager.get('bkit_categories') is None:
+ categories.fetch_categories_thread(api_key)
first_time = True
@@ -622,6 +623,7 @@ def fetch_author(a_id, api_key):
utils.p(e)
utils.p('finish fetch')
+# profile_counter =0
def get_author(r):
a_id = str(r['author']['id'])
@@ -630,11 +632,13 @@ def get_author(r):
if authors == {}:
bpy.context.window_manager['bkit authors'] = authors
a = authors.get(a_id)
- if a is None or a is '' or \
- (a.get('gravatarHash') is not None and a.get('gravatarImg') is None):
- authors[a_id] = None
+ if a is None:# or a is '' or (a.get('gravatarHash') is not None and a.get('gravatarImg') is None):
+ authors[a_id] = ''
thread = threading.Thread(target=fetch_author, args=(a_id, preferences.api_key), daemon=True)
thread.start()
+ # global profile_counter
+ # profile_counter+=1
+ # print(profile_counter,'author:', a_id)
return a