diff --git a/default.py b/default.py index 8cfb9ae9..f2edfc06 100644 --- a/default.py +++ b/default.py @@ -172,8 +172,7 @@ class Main(): utils.window('plex_runLibScan', value="full") elif mode == "texturecache": - import artwork - artwork.Artwork().fullTextureCacheSync() + utils.window('plex_runLibScan', value='del_textures') else: entrypoint.doMainListing() diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index db6fb9dc..9db2ab39 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -453,7 +453,7 @@ - Running the image cache process can take some time. Are you sure you want continue? + Running the image cache process can take some time. It will happen in the background. Are you sure you want continue? Reset all existing cache data first? diff --git a/resources/language/German/strings.xml b/resources/language/German/strings.xml index 16176b81..16337583 100644 --- a/resources/language/German/strings.xml +++ b/resources/language/German/strings.xml @@ -391,7 +391,7 @@ - Alle Plex Bilder in Kodi zwischenzuspeichern kann sehr lange dauern. Möchten Sie wirklich fortfahren? + Alle Plex Bilder in Kodi zwischenzuspeichern kann lange dauern. Es wird im Hintergrund stattfinden. Möchten Sie wirklich fortfahren? Sollen erst alle bestehenden Bilder im Cache gelöscht werden? diff --git a/resources/lib/artwork.py b/resources/lib/artwork.py index cbdc88c2..9021c58e 100644 --- a/resources/lib/artwork.py +++ b/resources/lib/artwork.py @@ -191,7 +191,7 @@ class Image_Cache_Thread(Thread): break queue.task_done() # Sleep for a bit to reduce CPU strain - xbmc.sleep(20) + xbmc.sleep(50) log.info("---===### Stopped Image_Cache_Thread ###===---") @@ -214,9 +214,6 @@ class Artwork(): log.info("Doing Image Cache Sync") - pdialog = xbmcgui.DialogProgress() - pdialog.create("PlexKodiConnect", "Image Cache Sync") - # ask to rest all existing or not if xbmcgui.Dialog().yesno( "Image Texture Cache", lang(39251), ""): @@ -256,53 +253,22 @@ class Artwork(): cursor.execute("SELECT url FROM art WHERE media_type != 'actor'") result = cursor.fetchall() total = len(result) - log.info("Image cache sync about to process %s images" % total) + log.info("Image cache sync about to process %s video images" % total) connection.close() - count = 0 for url in result: - if pdialog.iscanceled(): - break - - percentage = int((float(count) / float(total))*100) - message = "%s of %s (%s)" % (count, total, self.imageCacheThreads) - pdialog.update(percentage, "%s %s" % (lang(33045), message)) self.cacheTexture(url[0]) - count += 1 # Cache all entries in music DB connection = kodiSQL('music') cursor = connection.cursor() cursor.execute("SELECT url FROM art") result = cursor.fetchall() total = len(result) - log.info("Image cache sync about to process %s images" % total) + log.info("Image cache sync about to process %s music images" % total) connection.close() - - count = 0 for url in result: - if pdialog.iscanceled(): - break - - percentage = int((float(count) / float(total))*100) - message = "%s of %s" % (count, total) - pdialog.update(percentage, "%s %s" % (lang(33045), message)) self.cacheTexture(url[0]) - count += 1 - pdialog.update(100, "%s %s" - % (lang(33046), len(self.imageCacheThreads))) - log.info("Waiting for all threads to exit") - while len(self.imageCacheThreads): - with self.lock: - for thread in self.imageCacheThreads: - if thread.is_finished: - self.imageCacheThreads.remove(thread) - pdialog.update(100, "%s %s" - % (lang(33046), len(self.imageCacheThreads))) - log.info("Waiting for all threads to exit: %s" - % len(self.imageCacheThreads)) - xbmc.sleep(500) - - pdialog.close() + log.info('Done throwing URLs to art download daemon') def cacheTexture(self, url): # Cache a single image url to the texture cache diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 868fcd4a..a3f25bdc 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -1803,6 +1803,12 @@ class LibrarySync(Thread): line1=lang(39223), nolabel=lang(39224), yeslabel=lang(39225))) + elif window('plex_runLibScan') == 'del_textures': + window('plex_runLibScan', clear=True) + window('plex_dbScan', value="true") + import artwork + artwork.Artwork().fullTextureCacheSync() + window('plex_dbScan', clear=True) else: now = getUnixTimestamp() if (now - lastSync > fullSyncInterval and