use "special://" as root and translate before writes

This commit is contained in:
Rob Weber 2014-08-08 10:37:16 -05:00
parent b14fda20fb
commit eb2f5dce74
2 changed files with 6 additions and 5 deletions

View File

@ -38,7 +38,7 @@ class XbmcBackup:
skip_advanced = False #if we should check for the existance of advancedsettings in the restore skip_advanced = False #if we should check for the existance of advancedsettings in the restore
def __init__(self): def __init__(self):
self.xbmc_vfs = XBMCFileSystem(xbmc.translatePath('special://home')) self.xbmc_vfs = XBMCFileSystem('special://home')
self.configureRemote() self.configureRemote()
utils.log(utils.getString(30046)) utils.log(utils.getString(30046))
@ -237,7 +237,7 @@ class XbmcBackup:
self.backupFiles(fileGroup['files'],self.xbmc_vfs,self.remote_vfs) self.backupFiles(fileGroup['files'],self.xbmc_vfs,self.remote_vfs)
#reset remote and xbmc vfs #reset remote and xbmc vfs
self.xbmc_vfs.set_root(xbmc.translatePath("special://home")) self.xbmc_vfs.set_root("special://home/")
self.remote_vfs.set_root(orig_base_path) self.remote_vfs.set_root(orig_base_path)
if(utils.getSetting("compress_backups") == 'true'): if(utils.getSetting("compress_backups") == 'true'):
@ -287,7 +287,7 @@ class XbmcBackup:
#set the new remote vfs and fix xbmc path #set the new remote vfs and fix xbmc path
self.remote_vfs = XBMCFileSystem(xbmc.translatePath("special://temp/" + self.restore_point.split(".")[0] + "/")) self.remote_vfs = XBMCFileSystem(xbmc.translatePath("special://temp/" + self.restore_point.split(".")[0] + "/"))
self.xbmc_vfs.set_root(xbmc.translatePath("special://home")) self.xbmc_vfs.set_root("special://home/")
#for restores remote path must exist #for restores remote path must exist

View File

@ -62,10 +62,11 @@ class XBMCFileSystem(Vfs):
return xbmcvfs.listdir(directory) return xbmcvfs.listdir(directory)
def mkdir(self,directory): def mkdir(self,directory):
return xbmcvfs.mkdir(directory) return xbmcvfs.mkdir(xbmc.translatePath(directory))
def put(self,source,dest): def put(self,source,dest):
return xbmcvfs.copy(source,dest) utils.log(dest)
return xbmcvfs.copy(xbmc.translatePath(source),xbmc.translatePath(dest))
def rmdir(self,directory): def rmdir(self,directory):
return xbmcvfs.rmdir(directory,True) return xbmcvfs.rmdir(directory,True)