diff --git a/addon.xml b/addon.xml index b4e80d4..c77596a 100644 --- a/addon.xml +++ b/addon.xml @@ -1,6 +1,6 @@  + name="XBMC Backup" version="0.4.2" provider-name="robweber"> diff --git a/changelog.txt b/changelog.txt index a2c1382..e2e251c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +Version 0.4.2 + +Added support for userdata/profiles folder - thanks TUSSFC + Version 0.4.1 added encode() around notifications diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index 64af3fe..a2faeb1 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -71,4 +71,5 @@ Restart XBMC You should restart XBMC to continue Just Today + Profiles diff --git a/resources/lib/backup.py b/resources/lib/backup.py index 11b6e8e..d04c1d8 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -119,7 +119,11 @@ class XbmcBackup: if(utils.getSetting("backup_playlists") == 'true'): self.remote_vfs.mkdir(self.remote_vfs.root_path + "userdata/playlists") fileManager.walkTree(xbmc.translatePath('special://home/userdata/playlists')) - + + if(utils.getSetting('backup_profiles') == 'true'): + self.remote_vfs.mkdir(self.remote_vfs.root_path + "userdata/profiles") + fileManager.walkTree(xbmc.translatePath('special://home/userdata/profiles')) + if(utils.getSetting("backup_thumbnails") == "true"): self.remote_vfs.mkdir(self.remote_vfs.root_path + "userdata/Thumbnails") fileManager.walkTree(xbmc.translatePath('special://home/userdata/Thumbnails')) @@ -237,6 +241,10 @@ class XbmcBackup: if(utils.getSetting("backup_playlists") == 'true'): self.xbmc_vfs.mkdir(xbmc.translatePath('special://home/userdata/playlists')) fileManager.walkTree(self.remote_vfs.root_path + "userdata/playlists") + + if(utils.getSetting('backup_profiles') == 'true'): + self.xbmc_vfs.mkdir(xbmc.translatePath('special://home/userdata/profiles')) + fileManager.walkTree(self.remote_vfs.root_path + "userdata/profiles") if(utils.getSetting("backup_thumbnails") == "true"): self.xbmc_vfs.mkdir(xbmc.translatePath('special://home/userdata/Thumbnails')) @@ -371,21 +379,22 @@ class FileManager: self.vfs = vfs def walkTree(self,directory): - dirs,files = self.vfs.listdir(directory) + if(self.vfs.exists(directory)): + dirs,files = self.vfs.listdir(directory) - #create all the subdirs first - for aDir in dirs: - 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)): - self.walkTree(dirPath) + #create all the subdirs first + for aDir in dirs: + 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)): + self.walkTree(dirPath) - #copy all the files - for aFile in files: - filePath = xbmc.translatePath(directory + "/" + aFile) - self.addFile(filePath) + #copy all the files + for aFile in files: + filePath = xbmc.translatePath(directory + "/" + aFile) + self.addFile(filePath) def addFile(self,filename): try: diff --git a/resources/settings.xml b/resources/settings.xml index 0936f1e..e14e466 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -14,6 +14,7 @@ +