fix music library fallback and update code style

This commit is contained in:
herby2212 2021-03-14 23:59:03 +01:00
parent 4c47501687
commit bd65e75cf4
3 changed files with 9 additions and 3 deletions

View file

@ -556,4 +556,5 @@ class Config(object):
home_stats_cards.add('top_libaries')
self.HOME_STATS_CARDS = home_stats_cards
self.CONFIG_VERSION = 18
self.CONFIG_VERSION = 18

View file

@ -909,6 +909,9 @@ class DataFactory(object):
for item in result:
library_item = library_data.get_watch_time_stats(section_id=item['section_id'], grouping=None , query_days=time_range)
if library_item[0]['total_plays'] == 0 and library_item[0]['total_time'] == 0:
continue
if item['custom_thumb'] and item['custom_thumb'] != item['library_thumb']:
library_thumb = item['custom_thumb']
elif item['library_thumb']:
@ -938,7 +941,9 @@ class DataFactory(object):
'stat_id': stat,
'stat_type': sort_type,
'stat_title': 'Most Active Libraries',
'rows': session.mask_session_info(sorted(top_libraries, key=lambda k: k[sort_type], reverse=True), mask_metadata=False)
'rows': session.mask_session_info(
sorted(top_libraries, key=lambda k: k[sort_type], reverse=True),
mask_metadata=False)
})
if stat_id and home_stats: