mirror of
https://github.com/gordielachance/plugin.audio.subsonic
synced 2025-02-02 10:26:48 +01:00
hide artist in lists if it is unique
This commit is contained in:
parent
f80b6458a1
commit
5117218f86
15
main.py
15
main.py
@ -339,7 +339,15 @@ def list_albums(params):
|
||||
plugin.log('list_albums with args:' + query_args_json);
|
||||
|
||||
#Get items
|
||||
items = connection.walk_albums(**query_args)
|
||||
generator = connection.walk_albums(**query_args)
|
||||
|
||||
#make a list out of the generator so we can iterate it several times
|
||||
items = list(generator)
|
||||
|
||||
#check if there is only one artist for this album (and then hide it)
|
||||
artists = [item.get('artist',None) for item in items]
|
||||
if len(artists) <= 1:
|
||||
params['hide_artist'] = True
|
||||
|
||||
# Iterate through items
|
||||
for item in items:
|
||||
@ -578,6 +586,11 @@ def list_tracks(params):
|
||||
|
||||
#make a list out of the generator so we can iterate it several times
|
||||
items = list(generator)
|
||||
|
||||
#check if there is only one artist for this album (and then hide it)
|
||||
artists = [item.get('artist',None) for item in items]
|
||||
if len(artists) <= 1:
|
||||
params['hide_artist'] = True
|
||||
|
||||
#update stars
|
||||
if menu_id == 'tracks_starred':
|
||||
|
Loading…
x
Reference in New Issue
Block a user