2 Commits

Author SHA1 Message Date
Rob Weber
858bd6170a beta version 2019-11-26 13:45:15 -06:00
Rob Weber
1fb013f335 added custom zip file per #158 and #145 2019-11-26 13:43:55 -06:00
5 changed files with 1280 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.xbmcbackup" <addon id="script.xbmcbackup"
name="Backup" version="1.5.3" provider-name="robweber"> name="Backup" version="1.5.3~beta1" provider-name="robweber">
<requires> <requires>
<!-- jarvis --> <!-- jarvis -->
<import addon="xbmc.python" version="2.25.0"/> <import addon="xbmc.python" version="2.25.0"/>
@@ -95,9 +95,7 @@
<screenshot>resources/images/screenshot3.png</screenshot> <screenshot>resources/images/screenshot3.png</screenshot>
<screenshot>resources/images/screenshot4.png</screenshot> <screenshot>resources/images/screenshot4.png</screenshot>
</assets> </assets>
<news>Version 1.5.3 <news>Version 1.5.2
- fixed issue with backup rotation when basepath not formatted correctly - thanks @AnonTester
Version 1.5.2
- Added script.module.dropbox import as a dependency for Dropbox filesystem - Added script.module.dropbox import as a dependency for Dropbox filesystem
- Fixed issue getting xbmcbackup.val file from non-zipped remote directories. Was being copied as though it was a local file so it was failing. - Fixed issue getting xbmcbackup.val file from non-zipped remote directories. Was being copied as though it was a local file so it was failing.
- Use linux path separator (/) all the time, Kodi will interpret this correctly on windows. Was causing issues with remote file systems since os.path.sep - Use linux path separator (/) all the time, Kodi will interpret this correctly on windows. Was causing issues with remote file systems since os.path.sep

View File

@@ -4,15 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [Version 1.5.3](https://github.com/robweber/xbmcbackup/compare/krypton-1.5.2...robweber:krypton-1.5.3) - 2019-12-30 ## [Unreleased](https://github.com/robweber/xbmcbackup/compare/krypton-1.5.2...HEAD)
### Added ### Added
- added new badges for Kodi Version, TravisCI and license information from shields.io - added new badges for Kodi Version, TravisCI and license information from shields.io
- added custom zipfile.py version to replace built in zip module
### Changed
- backported a fix from Matrix that fixes backup rotation paths when slashes are missing from the base path (thanks @AnonTester)
## [Version 1.5.2](https://github.com/robweber/xbmcbackup/compare/krypton-1.5.1...robweber:krypton-1.5.2) - 2019-09-30 ## [Version 1.5.2](https://github.com/robweber/xbmcbackup/compare/krypton-1.5.1...robweber:krypton-1.5.2) - 2019-09-30

View File

@@ -461,9 +461,9 @@ class XbmcBackup:
if(dirs[remove_num][0].split('.')[-1] == 'zip'): if(dirs[remove_num][0].split('.')[-1] == 'zip'):
#this is a file, remove it that way #this is a file, remove it that way
self.remote_vfs.rmfile(self.remote_vfs.clean_path(self.remote_base_path) + dirs[remove_num][0]) self.remote_vfs.rmfile(self.remote_base_path + dirs[remove_num][0])
else: else:
self.remote_vfs.rmdir(self.remote_vfs.clean_path(self.remote_base_path) + dirs[remove_num][0] + "/") self.remote_vfs.rmdir(self.remote_base_path + dirs[remove_num][0] + "/")
remove_num = remove_num + 1 remove_num = remove_num + 1

View File

@@ -1,7 +1,7 @@
import xbmc import xbmc
import xbmcvfs import xbmcvfs
import xbmcgui import xbmcgui
import zipfile from . import zipfile
import os.path import os.path
import sys import sys
import dropbox import dropbox
@@ -15,19 +15,16 @@ class Vfs:
def __init__(self,rootString): def __init__(self,rootString):
self.set_root(rootString) self.set_root(rootString)
def clean_path(self, path):
# fix slashes
path = path.replace("\\", "/")
# check if trailing slash is included
if(path[-1:] != '/'):
path = path + '/'
return path
def set_root(self,rootString): def set_root(self,rootString):
old_root = self.root_path old_root = self.root_path
self.root_path = self.clean_path(rootString) self.root_path = rootString
#fix slashes
self.root_path = self.root_path.replace("\\","/")
#check if trailing slash is included
if(self.root_path[-1:] != "/"):
self.root_path = self.root_path + "/"
#return the old root #return the old root
return old_root return old_root

1263
resources/lib/zipfile.py Normal file

File diff suppressed because it is too large Load Diff