diff --git a/addon.xml b/addon.xml index 150d863..8e5a202 100644 --- a/addon.xml +++ b/addon.xml @@ -1,6 +1,6 @@  + name="Backup" version="1.0.5" provider-name="robweber"> diff --git a/changelog.txt b/changelog.txt index e460b78..a6e8e2e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,11 @@ +Version 1.0.5 + +make compression setting compatible with python 2.6 and above + +Version 1.0.4 + +exit if we can't delete the old archive, non recoverable + Version 1.0.3 added "delete auth" dialog to delete oauth files in settings diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index 6d9b291..1e72c8e 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -87,5 +87,6 @@ Delete Authorization Info This will delete any OAuth token files Do you want to do this? - Google Drive + Old Zip Archive could not be deleted + This needs to happen before a backup can run diff --git a/resources/lib/backup.py b/resources/lib/backup.py index 8030da9..f30a449 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -121,7 +121,10 @@ class XbmcBackup: if(utils.getSetting("compress_backups") == 'true'): #delete old temp file if(self.xbmc_vfs.exists(xbmc.translatePath('special://temp/xbmc_backup_temp.zip'))): - self.xbmc_vfs.rmfile(xbmc.translatePath('special://temp/xbmc_backup_temp.zip')) + if(not self.xbmc_vfs.rmfile(xbmc.translatePath('special://temp/xbmc_backup_temp.zip'))): + #we had some kind of error deleting the old file + xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30096),utils.getString(30097)) + return #save the remote file system and use the zip vfs self.saved_remote_vfs = self.remote_vfs diff --git a/resources/lib/vfs.py b/resources/lib/vfs.py index 505d6bc..e21bf18 100644 --- a/resources/lib/vfs.py +++ b/resources/lib/vfs.py @@ -81,7 +81,7 @@ class ZipFileSystem(Vfs): def __init__(self,rootString,mode): self.root_path = "" - self.zip = zipfile.ZipFile(rootString,mode=mode,allowZip64=True) + self.zip = zipfile.ZipFile(rootString,mode=mode,compression=zipfile.ZIP_DEFLATED,allowZip64=True) def listdir(self,directory): return [[],[]] @@ -94,7 +94,7 @@ class ZipFileSystem(Vfs): aFile = xbmcvfs.File(xbmc.translatePath(source),'r') - self.zip.writestr(utils.encode(dest),aFile.read(),compress_type=zipfile.ZIP_DEFLATED) + self.zip.writestr(utils.encode(dest),aFile.read()) return True