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):