mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-14 20:35:48 +01:00
updated scripting to pass in list of sets to restore
This commit is contained in:
parent
83a01a48bf
commit
545bd93e8c
@ -70,7 +70,10 @@ 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:
|
||||
|
@ -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']]
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user