check for restores right away

This commit is contained in:
Rob Weber 2021-04-16 09:30:22 -05:00
parent f7e77fd739
commit 76e8e0efeb

View File

@ -22,6 +22,21 @@ class BackupScheduler:
self.enabled = utils.getSettingBool("enable_scheduler") self.enabled = utils.getSettingBool("enable_scheduler")
self.next_run_path = xbmcvfs.translatePath(utils.data_dir()) + 'next_run.txt' self.next_run_path = xbmcvfs.translatePath(utils.data_dir()) + 'next_run.txt'
# display upgrade messages if they exist
if(utils.getSettingInt('upgrade_notes') < UPGRADE_INT):
xbmcgui.Dialog().ok(utils.getString(30010), utils.getString(30132))
utils.setSetting('upgrade_notes', str(UPGRADE_INT))
# check if a backup should be resumed
resumeRestore = self._resumeCheck()
if(resumeRestore):
restore = XbmcBackup()
restore.selectRestore(self.restore_point)
# skip the advanced settings check
restore.skipAdvanced()
restore.restore()
if(self.enabled): if(self.enabled):
# sleep for 2 minutes so Kodi can start and time can update correctly # sleep for 2 minutes so Kodi can start and time can update correctly
@ -56,21 +71,6 @@ class BackupScheduler:
def start(self): def start(self):
# display upgrade messages if they exist
if(utils.getSettingInt('upgrade_notes') < UPGRADE_INT):
xbmcgui.Dialog().ok(utils.getString(30010), utils.getString(30132))
utils.setSetting('upgrade_notes', str(UPGRADE_INT))
# check if a backup should be resumed
resumeRestore = self._resumeCheck()
if(resumeRestore):
restore = XbmcBackup()
restore.selectRestore(self.restore_point)
# skip the advanced settings check
restore.skipAdvanced()
restore.restore()
while(not self.monitor.abortRequested()): while(not self.monitor.abortRequested()):
if(self.enabled): if(self.enabled):