diff --git a/resources/lib/downloader.py b/resources/lib/downloader.py index b9623ae7..7a9d49c2 100644 --- a/resources/lib/downloader.py +++ b/resources/lib/downloader.py @@ -301,6 +301,8 @@ def get_objects(src, filename): ''' temp = xbmc.translatePath('special://temp/emby').decode('utf-8') final = os.path.join(temp, "objects") + restart = not xbmcvfs.exists(final + '/') # add slash for verification + delete_folder() LOG.info(src) @@ -325,5 +327,7 @@ def get_objects(src, filename): try: shutil.copytree(src=os.path.join(extracted, "objects"), dst=final) delete_folder(extracted) + + return restart except Exception as error: raise diff --git a/resources/lib/entrypoint/service.py b/resources/lib/entrypoint/service.py index 2ba69be8..dc775896 100644 --- a/resources/lib/entrypoint/service.py +++ b/resources/lib/entrypoint/service.py @@ -149,12 +149,11 @@ class Service(xbmc.Monitor): return - get_objects(zipfile, label + '.zip') + if get_objects(zipfile, label + '.zip'): # no patch applied previously + dialog("ok", heading="{emby}", line1=_(33135)) + xbmc.executebuiltin('RestartApp') except Exception as error: LOG.info(error) - - dialog("ok", heading="{emby}", line1=_(33135)) - xbmc.executebuiltin('RestartApp') def onNotification(self, sender, method, data):