From 76e8e0efeb98c3863f5e0f130195162a55c48efc Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Fri, 16 Apr 2021 09:30:22 -0500 Subject: [PATCH] check for restores right away --- resources/lib/scheduler.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/resources/lib/scheduler.py b/resources/lib/scheduler.py index 61f13b9..eb41350 100644 --- a/resources/lib/scheduler.py +++ b/resources/lib/scheduler.py @@ -22,6 +22,21 @@ class BackupScheduler: self.enabled = utils.getSettingBool("enable_scheduler") 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): # sleep for 2 minutes so Kodi can start and time can update correctly @@ -56,21 +71,6 @@ class BackupScheduler: 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()): if(self.enabled):