BlenderKit: fix search by author verification status
fix ratings drawing for not logged in users fix ratings update function(was reacting to quality rating)
This commit is contained in:
parent
48c8d6c230
commit
943d41d443
|
@ -481,6 +481,7 @@ class BlenderKitCommonSearchProps(object):
|
|||
('DELETED', 'Deleted', 'Deleted'),
|
||||
),
|
||||
default='ALL',
|
||||
update=search.search_update,
|
||||
)
|
||||
|
||||
|
||||
|
@ -655,7 +656,7 @@ class BlenderKitRatingProps(PropertyGroup):
|
|||
|
||||
rating_work_hours: FloatProperty(name="Work Hours",
|
||||
description="How many hours did this work take?",
|
||||
default=0.01,
|
||||
default=0.00,
|
||||
min=0.0, max=1000, update=ratings.update_ratings_work_hours
|
||||
)
|
||||
rating_complexity: IntProperty(name="Complexity",
|
||||
|
|
|
@ -128,7 +128,7 @@ def update_ratings_work_hours(self, context):
|
|||
bkit_ratings = asset.bkit_ratings
|
||||
url = paths.get_api_url() + 'assets/' + asset['asset_data']['id'] + '/rating/'
|
||||
|
||||
if bkit_ratings.rating_quality > 0.1:
|
||||
if bkit_ratings.rating_work_hours > 0.05:
|
||||
ratings = [('working_hours', round(bkit_ratings.rating_work_hours, 1))]
|
||||
tasks_queue.add_task((send_rating_to_thread_work_hours, (url, ratings, headers)), wait=1, only_last=True)
|
||||
|
||||
|
|
|
@ -1688,10 +1688,12 @@ class AssetBarOperator(bpy.types.Operator):
|
|||
if a is not None:
|
||||
sprops = utils.get_search_props()
|
||||
sprops.search_keywords = ''
|
||||
sprops.search_verification_status = 'ALL'
|
||||
utils.p('author:', a)
|
||||
search.search(author_id=a)
|
||||
return {'RUNNING_MODAL'}
|
||||
if event.type == 'X' and ui_props.active_index > -1:
|
||||
# delete downloaded files for this asset
|
||||
sr = bpy.context.scene['search results']
|
||||
asset_data = sr[ui_props.active_index]
|
||||
print(asset_data['name'])
|
||||
|
|
|
@ -74,15 +74,16 @@ def draw_ratings(layout, context):
|
|||
if asset == None:
|
||||
return;
|
||||
|
||||
col = layout.column()
|
||||
if not utils.user_logged_in():
|
||||
label_multiline(layout, text='Please login or sign up '
|
||||
'to rate assets.')
|
||||
return
|
||||
col.enabled = False
|
||||
bkit_ratings = asset.bkit_ratings
|
||||
|
||||
ratings.draw_rating(layout, bkit_ratings, 'rating_quality', 'Quality')
|
||||
layout.separator()
|
||||
layout.prop(bkit_ratings, 'rating_work_hours')
|
||||
ratings.draw_rating(col, bkit_ratings, 'rating_quality', 'Quality')
|
||||
col.separator()
|
||||
col.prop(bkit_ratings, 'rating_work_hours')
|
||||
w = context.region.width
|
||||
|
||||
# layout.label(text='problems')
|
||||
|
@ -93,6 +94,7 @@ def draw_ratings(layout, context):
|
|||
# row = layout.row()
|
||||
# op = row.operator("object.blenderkit_rating_upload", text="Send rating", icon='URL')
|
||||
# return op
|
||||
#re-enable layout if included in longer panel
|
||||
|
||||
|
||||
def draw_not_logged_in(source):
|
||||
|
|
Loading…
Reference in New Issue