[Bf-extensions-cvs] [1de6eef1] master: BlenderKit: allow empty input search, shows latest assets by now.
Vilém Duha
noreply at git.blender.org
Tue Jan 7 11:43:58 CET 2020
Commit: 1de6eef1ec6803d87b8027937728622a8ac6c917
Author: Vilém Duha
Date: Mon Jan 6 14:46:07 2020 +0100
Branches: master
https://developer.blender.org/rBA1de6eef1ec6803d87b8027937728622a8ac6c917
BlenderKit: allow empty input search, shows latest assets by now.
===================================================================
M blenderkit/search.py
===================================================================
diff --git a/blenderkit/search.py b/blenderkit/search.py
index 7fc540c6..ddb85410 100644
--- a/blenderkit/search.py
+++ b/blenderkit/search.py
@@ -733,8 +733,10 @@ class Searcher(threading.Thread):
requeststring += '+'
# result ordering: _score - relevance, score - BlenderKit score
-
- if query.get('author_id') is not None and profile_is_validator():
+ #first condition assumes no keywords and no category, thus an empty search that is triggered on start.
+ if query['keywords'] == '' and query.get('category_subtree') == None:
+ requeststring += '+order:-created'
+ elif query.get('author_id') is not None and profile_is_validator():
requeststring += '+order:-created'
else:
if query.get('category_subtree') is not None:
@@ -1106,8 +1108,9 @@ def search(category='', get_next=False, author_id=''):
def search_update(self, context):
utils.p('search updater')
- if self.search_keywords != '':
- search()
+ #if self.search_keywords != '':
+ search()
+ kp.semi()
class SearchOperator(Operator):
More information about the Bf-extensions-cvs
mailing list