mirror of
https://github.com/robweber/xbmcbackup.git
synced 2025-07-14 21:02:17 +02:00
Merge branch 'master' into leia
This commit is contained in:
@ -138,7 +138,7 @@ class XbmcBackup:
|
||||
selectedDirs = self._readBackupConfig(utils.data_dir() + "/custom_paths.json")
|
||||
|
||||
#get the set names
|
||||
keys = selectedDirs.keys()
|
||||
keys = list(selectedDirs.keys())
|
||||
|
||||
#go through the custom sets
|
||||
for aKey in keys:
|
||||
@ -496,7 +496,10 @@ class XbmcBackup:
|
||||
result = None
|
||||
|
||||
#copy the file and open it
|
||||
self.xbmc_vfs.put(path + "xbmcbackup.val",xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"))
|
||||
if(isinstance(self.remote_vfs,DropboxFileSystem) or isinstance(self.remote_vfs,GoogleDriveFilesystem)):
|
||||
self.remote_vfs.get_file(path + "xbmcbackup.val", xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"))
|
||||
else:
|
||||
self.xbmc_vfs.put(path + "xbmcbackup.val",xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"))
|
||||
|
||||
vFile = xbmcvfs.File(xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"),'r')
|
||||
jsonString = vFile.read()
|
||||
@ -535,6 +538,7 @@ class FileManager:
|
||||
not_dir = ['.zip','.xsp','.rar']
|
||||
exclude_dir = []
|
||||
root_dirs = []
|
||||
pathSep = '/'
|
||||
|
||||
def __init__(self,vfs):
|
||||
self.vfs = vfs
|
||||
@ -553,13 +557,13 @@ class FileManager:
|
||||
if(directory[-1:] == '/' or directory[-1:] == '\\'):
|
||||
directory = directory[:-1]
|
||||
|
||||
if(self.vfs.exists(directory + os.path.sep)):
|
||||
if(self.vfs.exists(directory + self.pathSep)):
|
||||
dirs,files = self.vfs.listdir(directory)
|
||||
|
||||
if(recurse):
|
||||
#create all the subdirs first
|
||||
for aDir in dirs:
|
||||
dirPath = xbmc.validatePath(xbmc.translatePath(directory + os.path.sep + aDir))
|
||||
dirPath = xbmc.validatePath(xbmc.translatePath(directory + self.pathSep + aDir))
|
||||
file_ext = aDir.split('.')[-1]
|
||||
|
||||
#check if directory is excluded
|
||||
@ -579,7 +583,7 @@ class FileManager:
|
||||
|
||||
#copy all the files
|
||||
for aFile in files:
|
||||
filePath = xbmc.translatePath(directory + os.path.sep + aFile)
|
||||
filePath = xbmc.translatePath(directory + self.pathSep + aFile)
|
||||
self.addFile(filePath)
|
||||
|
||||
def addDir(self,dirMeta):
|
||||
|
Reference in New Issue
Block a user