From 5ab2a7db5c64d39800d82809d6739a60127bb709 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 14 Sep 2018 18:01:18 -0500 Subject: [PATCH] Fix update library Plug in remove library percentage --- resources/lib/full_sync.py | 10 +++++++--- resources/lib/library.py | 8 ++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/resources/lib/full_sync.py b/resources/lib/full_sync.py index dac4d74b..4daaa891 100644 --- a/resources/lib/full_sync.py +++ b/resources/lib/full_sync.py @@ -40,7 +40,7 @@ class FullSync(object): libraries = library_id.split(',') 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) if library and library[1] == 'mixed': @@ -51,6 +51,7 @@ class FullSync(object): self.mapping() xmls.sources() + if not xmls.advanced_settings(): self.start() @@ -189,9 +190,12 @@ class FullSync(object): except Exception as error: - dialog("ok", heading="{emby}", line1=_(33119)) + if not 'Failed to validate path' in error: + + dialog("ok", heading="{emby}", line1=_(33119)) + LOG.error("full sync exited unexpectedly") + save_sync(self.sync) - LOG.error("full sync exited unexpectedly") raise diff --git a/resources/lib/library.py b/resources/lib/library.py index 3fff5ccf..db63d141 100644 --- a/resources/lib/library.py +++ b/resources/lib/library.py @@ -380,6 +380,8 @@ class Library(threading.Thread): settings('MusicRescan.bool', False) if items: + count = 0 + with self.music_database_lock if media == 'music' else self.database_lock: with Database(media) as kodidb: @@ -391,16 +393,22 @@ class Library(threading.Thread): for item in movies: 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'] for item in tvshows: obj(item[0]) + dialog.update(int((float(count) / float(len(items))*100)), heading="%s: %s" % (_('addon_name'), library[0])) + count += 1 else: obj = MEDIA[items[0][1]](self.server, embydb, kodidb, self.direct_path)['Remove'] for item in items: obj(item[0]) + dialog.update(int((float(count) / float(len(items))*100)), heading="%s: %s" % (_('addon_name'), library[0])) + count += 1 sync = get_sync()