modified directories not backing up - thanks bertel333

This commit is contained in:
Rob Weber 2014-01-12 10:12:09 -06:00
parent d28596728b
commit 4dd6c90ab9
3 changed files with 16 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.xbmcbackup"
name="XBMC Backup" version="0.4.3" provider-name="robweber">
name="XBMC Backup" version="0.4.4" provider-name="robweber">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
</requires>

View File

@ -1,3 +1,7 @@
Version 0.4.4
modified the check for invalid file types
Version 0.4.3
added error message if remote directory is blank

View File

@ -387,6 +387,7 @@ class FileManager:
self.vfs = vfs
def walkTree(self,directory):
if(self.vfs.exists(directory)):
dirs,files = self.vfs.listdir(directory)
@ -395,12 +396,20 @@ class FileManager:
dirPath = xbmc.translatePath(directory + "/" + aDir)
file_ext = aDir.split('.')[-1]
self.addFile("-" + dirPath)
#catch for "non directory" type files
if (not any(file_ext in s for s in self.not_dir)):
shouldWalk = True
for s in file_ext:
if(s in self.not_dir):
shouldWalk = False
if(shouldWalk):
self.walkTree(dirPath)
#copy all the files
for aFile in files:
utils.log(aFile)
filePath = xbmc.translatePath(directory + "/" + aFile)
self.addFile(filePath)