Fix duplicates in views

This commit is contained in:
angelblue05 2018-09-13 01:44:39 -05:00
parent 2677f98012
commit f37fd7c983
3 changed files with 6 additions and 6 deletions

View file

@ -246,10 +246,10 @@ def get_sync():
except Exception: except Exception:
sync = {} sync = {}
sync['Libraries'] = sync.get('Libraries', []) sync['Libraries'] = list(set(sync.get('Libraries', [])))
sync['RestorePoint'] = sync.get('RestorePoint', {}) sync['RestorePoint'] = sync.get('RestorePoint', {})
sync['Whitelist'] = sync.get('Whitelist', []) sync['Whitelist'] = list(set(sync.get('Whitelist', [])))
sync['SortedViews'] = sync.get('SortedViews', []) sync['SortedViews'] = list(set(sync.get('SortedViews', [])))
return sync return sync

View file

@ -152,13 +152,13 @@ def get_artists(parent_id=None, basic=False, params=None, server_id=None):
for items in _get_items(query, server_id): for items in _get_items(query, server_id):
yield items yield items
def get_albums_by_artist(artist_id, basic=False, server_id=None): def get_albums_by_artist(artist_id, basic=False):
params = { params = {
'SortBy': "DateCreated", 'SortBy': "DateCreated",
'ArtistIds': artist_id 'ArtistIds': artist_id
} }
for items in get_items(None, "MusicAlbum", basic, params, server_id): for items in get_items(None, "MusicAlbum", basic, params):
yield items yield items
@stop() @stop()

View file

@ -133,7 +133,7 @@ class FullSync(object):
self.process_library(library) self.process_library(library)
if not library.startswith('Boxsets:'): if not library.startswith('Boxsets:') and library not in self.sync['Whitelist']:
self.sync['Whitelist'].append(library) self.sync['Whitelist'].append(library)
self.sync['Libraries'].pop(self.sync['Libraries'].index(library)) self.sync['Libraries'].pop(self.sync['Libraries'].index(library))