mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Fix boxset sync on startup, simplify code
This commit is contained in:
parent
af441efe82
commit
b094b7ba30
1 changed files with 9 additions and 3 deletions
|
@ -215,17 +215,23 @@ class FullSync(object):
|
||||||
if library_id.startswith('Boxsets:'):
|
if library_id.startswith('Boxsets:'):
|
||||||
boxset_library = {}
|
boxset_library = {}
|
||||||
|
|
||||||
if library_id and library_id == 'Boxsets:Refresh':
|
# Initial library sync is 'Boxsets:'
|
||||||
|
# Refresh from the addon menu is 'Boxsets:Refresh'
|
||||||
|
# Incremental syncs are 'Boxsets:$library_id'
|
||||||
|
sync_id = library_id.split(':')[1]
|
||||||
|
|
||||||
|
if not sync_id or sync_id == 'Refresh':
|
||||||
libraries = self.get_libraries()
|
libraries = self.get_libraries()
|
||||||
else:
|
else:
|
||||||
libraries = self.get_libraries(library_id.split('Boxsets:')[1])
|
libraries = self.get_libraries(sync_id)
|
||||||
|
|
||||||
for entry in libraries:
|
for entry in libraries:
|
||||||
if entry[2] == 'boxsets':
|
if entry[2] == 'boxsets':
|
||||||
boxset_library = {'Id': entry[0], 'Name': entry[1]}
|
boxset_library = {'Id': entry[0], 'Name': entry[1]}
|
||||||
break
|
break
|
||||||
|
|
||||||
if boxset_library:
|
if boxset_library:
|
||||||
if library_id.endswith('Refresh'):
|
if sync_id == 'Refresh':
|
||||||
self.refresh_boxsets(boxset_library)
|
self.refresh_boxsets(boxset_library)
|
||||||
else:
|
else:
|
||||||
self.boxsets(boxset_library)
|
self.boxsets(boxset_library)
|
||||||
|
|
Loading…
Reference in a new issue