diff --git a/default.py b/default.py index 870dbff..c748240 100644 --- a/default.py +++ b/default.py @@ -69,8 +69,11 @@ if(mode != -1): if(selectedRestore != -1): backup.selectRestore(restorePoints[selectedRestore][0]) - - backup.restore() + + if('sets' in params): + backup.restore(selectedSets=params['sets'].split('|')) + else: + backup.restore() else: backup.backup() else: diff --git a/resources/lib/backup.py b/resources/lib/backup.py index 962e7cc..aa4731c 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -213,7 +213,7 @@ class XbmcBackup: #close any files self._closeVFS() - def restore(self,progressOverride=False): + def restore(self,progressOverride=False,selectedSets=None): shouldContinue = self._setupVFS(self.Restore, progressOverride) if(shouldContinue): @@ -288,8 +288,13 @@ class XbmcBackup: #use a multiselect dialog to select sets to restore restoreSets = [n['name'] for n in valFile['directories']] - selectedSets = xbmcgui.Dialog().multiselect(utils.getString(30131),restoreSets) + #if passed in list, skip selection + if(selectedSets == None): + selectedSets = xbmcgui.Dialog().multiselect(utils.getString(30131),restoreSets) + else: + selectedSets = [restoreSets.index(n) for n in selectedSets if n in restoreSets] #if set name not found just skip it + if(selectedSets != None): #go through each of the directories in the backup and write them to the correct location for index in selectedSets: