added support for userdata/profiles folder

This commit is contained in:
Rob Weber 2013-10-21 08:59:04 -05:00
parent 2b14f23a1d
commit 968248aaaf
5 changed files with 30 additions and 15 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.1" provider-name="robweber">
name="XBMC Backup" version="0.4.2" provider-name="robweber">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
</requires>

View File

@ -1,3 +1,7 @@
Version 0.4.2
Added support for userdata/profiles folder - thanks TUSSFC
Version 0.4.1
added encode() around notifications

View File

@ -71,4 +71,5 @@
<string id="30077">Restart XBMC</string>
<string id="30078">You should restart XBMC to continue</string>
<string id="30079">Just Today</string>
<string id="30080">Profiles</string>
</strings>

View File

@ -120,6 +120,10 @@ class XbmcBackup:
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'))
@ -238,6 +242,10 @@ class XbmcBackup:
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'))
fileManager.walkTree(self.remote_vfs.root_path + "userdata/Thumbnails")
@ -371,6 +379,7 @@ class FileManager:
self.vfs = vfs
def walkTree(self,directory):
if(self.vfs.exists(directory)):
dirs,files = self.vfs.listdir(directory)
#create all the subdirs first

View File

@ -14,6 +14,7 @@
<setting id="backup_addon_data" type="bool" label="30031" default="false" />
<setting id="backup_database" type="bool" label="30032" default="true" />
<setting id="backup_playlists" type="bool" label="30033" default="true" />
<setting id="backup_profiles" type="bool" label="30080" default="false" />
<setting id="backup_thumbnails" type="bool" label="30034" default="true" />
<setting id="backup_config" type="bool" label="30035" default="true" />
<setting id="custom_dir_1_enable" type="bool" label="30036" default="false" />