mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-14 20:35:48 +01:00
need to reset vfs to default root dirs before copying zip
This commit is contained in:
parent
5dfa9d9b76
commit
b3bbdd6911
@ -199,6 +199,8 @@ class XbmcBackup:
|
||||
self.filesTotal = fileManager.size()
|
||||
allFiles.append({"source":self.xbmc_vfs.root_path,"dest":self.remote_vfs.root_path,"files":fileManager.getFiles()})
|
||||
|
||||
orig_base_path = self.remote_vfs.root_path
|
||||
|
||||
#check if there are custom directories
|
||||
if(utils.getSetting('custom_dir_1_enable') == 'true' and utils.getSetting('backup_custom_dir_1') != ''):
|
||||
|
||||
@ -230,6 +232,10 @@ class XbmcBackup:
|
||||
self.remote_vfs.set_root(fileGroup['dest'])
|
||||
self.backupFiles(fileGroup['files'],self.xbmc_vfs,self.remote_vfs)
|
||||
|
||||
#reset remote and xbmc vfs
|
||||
self.xbmc_vfs.set_root(xbmc.translatePath("special://home"))
|
||||
self.remote_vfs.set_root(orig_base_path)
|
||||
|
||||
if(utils.getSetting("compress_backups") == 'true'):
|
||||
#send the zip file to the real remote vfs
|
||||
zip_name = self.remote_vfs.root_path[:-1] + ".zip"
|
||||
@ -241,7 +247,7 @@ class XbmcBackup:
|
||||
self.xbmc_vfs.set_root(xbmc.translatePath("special://temp/"))
|
||||
|
||||
self.remote_vfs = self.saved_remote_vfs
|
||||
self.progressBar.updateProgress(0, "Copying Zip Archive")
|
||||
self.progressBar.updateProgress(98, "Copying Zip Archive")
|
||||
self.backupFiles(fileManager.getFiles(),self.xbmc_vfs, self.remote_vfs)
|
||||
|
||||
#delete the temp zip file
|
||||
@ -274,8 +280,9 @@ class XbmcBackup:
|
||||
zip_vfs = ZipFileSystem(xbmc.translatePath("special://temp/"+ self.restore_point),'r')
|
||||
zip_vfs.extract(xbmc.translatePath("special://temp/"))
|
||||
|
||||
#set the new remote vfs
|
||||
#set the new remote vfs and fix xbmc path
|
||||
self.remote_vfs = XBMCFileSystem(xbmc.translatePath("special://temp/" + self.restore_point.split(".")[0] + "/"))
|
||||
self.xbmc_vfs.set_root(xbmc.translatePath("special://home"))
|
||||
|
||||
|
||||
#for restores remote path must exist
|
||||
|
Loading…
Reference in New Issue
Block a user