mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-12-22 22:15:23 +01:00
updated scripting to pass in list of sets to restore
This commit is contained in:
parent
83a01a48bf
commit
545bd93e8c
@ -70,6 +70,9 @@ if(mode != -1):
|
||||
if(selectedRestore != -1):
|
||||
backup.selectRestore(restorePoints[selectedRestore][0])
|
||||
|
||||
if('sets' in params):
|
||||
backup.restore(selectedSets=params['sets'].split('|'))
|
||||
else:
|
||||
backup.restore()
|
||||
else:
|
||||
backup.backup()
|
||||
|
@ -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,7 +288,12 @@ class XbmcBackup:
|
||||
|
||||
#use a multiselect dialog to select sets to restore
|
||||
restoreSets = [n['name'] for n in valFile['directories']]
|
||||
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user