updated scripting to pass in list of sets to restore

This commit is contained in:
Rob Weber 2019-07-30 13:26:55 -05:00
parent 83a01a48bf
commit 545bd93e8c
2 changed files with 12 additions and 4 deletions

View File

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

View File

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