mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Merge pull request #494 from mcarlton00/subsequent-syncs
Fix syncing libraries after initial sync is complete
This commit is contained in:
commit
f9f1cccb97
1 changed files with 22 additions and 13 deletions
|
@ -77,21 +77,30 @@ class FullSync(object):
|
||||||
self.sync = get_sync()
|
self.sync = get_sync()
|
||||||
|
|
||||||
if library_id:
|
if library_id:
|
||||||
libraries = library_id.split(',')
|
|
||||||
|
|
||||||
for selected in libraries:
|
# Look up library in local Jellyfin database
|
||||||
|
library = self.get_library(library_id)
|
||||||
if selected not in [x.replace('Mixed:', "") for x in self.sync['Libraries']]:
|
|
||||||
library = self.get_library(selected)
|
|
||||||
|
|
||||||
if library:
|
if library:
|
||||||
|
if library.media_type == 'mixed':
|
||||||
self.sync['Libraries'].append("Mixed:%s" % selected)
|
self.sync['Libraries'].append("Mixed:%s" % library_id)
|
||||||
|
# Include boxsets library
|
||||||
if library.media_type in ('mixed', 'movies'):
|
libraries = self.get_libraries()
|
||||||
self.sync['Libraries'].append('Boxsets:%s' % selected)
|
boxsets = [row.view_id for row in libraries if row.media_type == 'boxsets']
|
||||||
|
if boxsets:
|
||||||
|
self.sync['Libraries'].append('Boxsets:%s' % boxsets[0])
|
||||||
|
elif library.media_type == 'movies':
|
||||||
|
self.sync['Libraries'].append(library_id)
|
||||||
|
# Include boxsets library
|
||||||
|
libraries = self.get_libraries()
|
||||||
|
boxsets = [row.view_id for row in libraries if row.media_type == 'boxsets']
|
||||||
|
if boxsets:
|
||||||
|
self.sync['Libraries'].append('Boxsets:%s' % boxsets[0])
|
||||||
else:
|
else:
|
||||||
self.sync['Libraries'].append(selected)
|
# Only called if the library isn't already known about
|
||||||
|
self.sync['Libraries'].append(library_id)
|
||||||
|
else:
|
||||||
|
self.sync['Libraries'].append(library_id)
|
||||||
else:
|
else:
|
||||||
self.mapping()
|
self.mapping()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue