Fix update library

Plug in remove library percentage
This commit is contained in:
angelblue05 2018-09-14 18:01:18 -05:00
parent 838ce36f44
commit 5ab2a7db5c
2 changed files with 15 additions and 3 deletions

View file

@ -40,7 +40,7 @@ class FullSync(object):
libraries = library_id.split(',') libraries = library_id.split(',')
for selected in libraries: for selected in libraries:
if selected not in [x.replace('Mixed:', "") for x in self.sync['Whitelist']]: if selected not in [x.replace('Mixed:', "") for x in self.sync['Libraries']]:
library = self.get_libraries(selected) library = self.get_libraries(selected)
if library and library[1] == 'mixed': if library and library[1] == 'mixed':
@ -51,6 +51,7 @@ class FullSync(object):
self.mapping() self.mapping()
xmls.sources() xmls.sources()
if not xmls.advanced_settings(): if not xmls.advanced_settings():
self.start() self.start()
@ -189,10 +190,13 @@ class FullSync(object):
except Exception as error: except Exception as error:
if not 'Failed to validate path' in error:
dialog("ok", heading="{emby}", line1=_(33119)) dialog("ok", heading="{emby}", line1=_(33119))
save_sync(self.sync)
LOG.error("full sync exited unexpectedly") LOG.error("full sync exited unexpectedly")
save_sync(self.sync)
raise raise
@progress() @progress()

View file

@ -380,6 +380,8 @@ class Library(threading.Thread):
settings('MusicRescan.bool', False) settings('MusicRescan.bool', False)
if items: if items:
count = 0
with self.music_database_lock if media == 'music' else self.database_lock: with self.music_database_lock if media == 'music' else self.database_lock:
with Database(media) as kodidb: with Database(media) as kodidb:
@ -391,16 +393,22 @@ class Library(threading.Thread):
for item in movies: for item in movies:
obj(item[0]) obj(item[0])
dialog.update(int((float(count) / float(len(items))*100)), heading="%s: %s" % (_('addon_name'), library[0]))
count += 1
obj = MEDIA['Series'](self.server, embydb, kodidb, self.direct_path)['Remove'] obj = MEDIA['Series'](self.server, embydb, kodidb, self.direct_path)['Remove']
for item in tvshows: for item in tvshows:
obj(item[0]) obj(item[0])
dialog.update(int((float(count) / float(len(items))*100)), heading="%s: %s" % (_('addon_name'), library[0]))
count += 1
else: else:
obj = MEDIA[items[0][1]](self.server, embydb, kodidb, self.direct_path)['Remove'] obj = MEDIA[items[0][1]](self.server, embydb, kodidb, self.direct_path)['Remove']
for item in items: for item in items:
obj(item[0]) obj(item[0])
dialog.update(int((float(count) / float(len(items))*100)), heading="%s: %s" % (_('addon_name'), library[0]))
count += 1
sync = get_sync() sync = get_sync()