mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-12-22 14:05:23 +01:00
updated scripting to pass in list of sets to restore
This commit is contained in:
parent
83a01a48bf
commit
545bd93e8c
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user