Modify applying patch

First time still requires a restart. Subsequent patches do not.
This commit is contained in:
angelblue05 2018-09-08 18:05:12 -05:00
parent 17fdf0e923
commit 5a63bd43a3
2 changed files with 7 additions and 4 deletions

View file

@ -301,6 +301,8 @@ def get_objects(src, filename):
''' '''
temp = xbmc.translatePath('special://temp/emby').decode('utf-8') temp = xbmc.translatePath('special://temp/emby').decode('utf-8')
final = os.path.join(temp, "objects") final = os.path.join(temp, "objects")
restart = not xbmcvfs.exists(final + '/') # add slash for verification
delete_folder() delete_folder()
LOG.info(src) LOG.info(src)
@ -325,5 +327,7 @@ def get_objects(src, filename):
try: try:
shutil.copytree(src=os.path.join(extracted, "objects"), dst=final) shutil.copytree(src=os.path.join(extracted, "objects"), dst=final)
delete_folder(extracted) delete_folder(extracted)
return restart
except Exception as error: except Exception as error:
raise raise

View file

@ -149,12 +149,11 @@ class Service(xbmc.Monitor):
return 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: except Exception as error:
LOG.info(error) LOG.info(error)
dialog("ok", heading="{emby}", line1=_(33135))
xbmc.executebuiltin('RestartApp')
def onNotification(self, sender, method, data): def onNotification(self, sender, method, data):