mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-14 20:35:48 +01:00
minor fixes
This commit is contained in:
parent
9add0b2981
commit
97a977c721
@ -313,7 +313,6 @@ 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(xbmc.translatePath("special://home/"))
|
||||||
|
|
||||||
|
|
||||||
#for restores remote path must exist
|
#for restores remote path must exist
|
||||||
if(not self.remote_vfs.exists(self.remote_vfs.root_path)):
|
if(not self.remote_vfs.exists(self.remote_vfs.root_path)):
|
||||||
@ -535,12 +534,15 @@ class XbmcBackup:
|
|||||||
result = False
|
result = False
|
||||||
|
|
||||||
#copy the file and open it
|
#copy the file and open it
|
||||||
self.xbmc_vfs.put(path + "xbmcbackup.val",xbmc.translatePath(utils.data_dir() + "xbmcbackup.val"))
|
self.xbmc_vfs.put(path + "xbmcbackup.val",xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"))
|
||||||
|
|
||||||
vFile = xbmcvfs.File(xbmc.translatePath(utils.data_dir() + "xbmcbackup.val"),'r')
|
vFile = xbmcvfs.File(xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"),'r')
|
||||||
jsonString = vFile.read()
|
jsonString = vFile.read()
|
||||||
vFile.close()
|
vFile.close()
|
||||||
|
|
||||||
|
#delete after checking
|
||||||
|
xbmcvfs.delete(xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
json_dict = json.loads(jsonString)
|
json_dict = json.loads(jsonString)
|
||||||
|
|
||||||
@ -568,6 +570,9 @@ class FileManager:
|
|||||||
self.fileArray = []
|
self.fileArray = []
|
||||||
|
|
||||||
def walkTree(self,directory):
|
def walkTree(self,directory):
|
||||||
|
|
||||||
|
if(directory[-1:] == '/'):
|
||||||
|
directory = directory[:-1]
|
||||||
|
|
||||||
if(self.vfs.exists(directory + "/")):
|
if(self.vfs.exists(directory + "/")):
|
||||||
dirs,files = self.vfs.listdir(directory)
|
dirs,files = self.vfs.listdir(directory)
|
||||||
|
Loading…
Reference in New Issue
Block a user