Compare commits

...

5 Commits

Author SHA1 Message Date
Rob Weber ca10bf7307 version bump 2024-04-17 11:43:24 -05:00
Rob Weber dc88c2615a updated news 2024-04-17 11:42:38 -05:00
Rob Weber 090842b03c prompt to close Kodi when restore completes
closes #228
2024-01-25 09:13:02 -06:00
Rob Weber f6fae17c19 updated changelog.md 2024-01-25 08:46:12 -06:00
Rob Weber 780f0f8401 added dict key to designate files instead of '-' sign 2024-01-24 15:42:07 -06:00
4 changed files with 21 additions and 10 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.xbmcbackup"
name="Backup" version="1.7.0~beta2" provider-name="robweber">
name="Backup" version="1.7.0" provider-name="robweber">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.dateutil" version="2.8.0" />
@@ -29,6 +29,7 @@ Can add suffix to backup folder names
translations sync
Minor UI fixes
Fixed Dropbox tokens expiring by using refresh tokens
Always recommend restart after a restore
</news>
<summary lang="ar_SA">إنسخ إحتياطياً قاعده بيانات إكس بى إم سى وملفات اﻹعدادات فى حاله وقوع إنهيار مع إمكانيه اﻹسترجاع</summary>
<summary lang="bg_BG">Добавката може да създава резервни копия и възстановява базата данни и настройките на Kodi, в случай на срив или повреда на файловете.</summary>
+3 -1
View File
@@ -4,12 +4,13 @@ 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/)
## Unreleased
## [Version 1.7.0](https://github.com/robweber/xbmcbackup/compare/matrix-1.6.8...robweber:matrix-1.7.0)
### Added
- You can now append a suffix to the end of each backup name (folder or zip file). This is only available in the Advanced or Expert settings.
- validation file now saves a list of all installed addons and versions
- prompt to close Kodi at the end of successful restore
### Changed
@@ -17,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- modified GitHub issue template slightly
- translations sync
- token files are stored in a `.json` instead of a `.txt` file
- file discovery process now flags directories with an `is_dir` metadata property instead of prefixing with a dash (-). This was done for legacy reasons and there is no reason for it.
### Fixed
@@ -294,7 +294,7 @@ msgid "Restart Kodi"
msgstr ""
msgctxt "#30078"
msgid "You should restart Kodi to continue"
msgid "A restart is recommended, select Yes to close Kodi"
msgstr ""
msgctxt "#30079"
+15 -7
View File
@@ -285,7 +285,9 @@ class XbmcBackup:
self._createResumeBackupFile()
# do not continue running
xbmcgui.Dialog().ok(utils.getString(30077), utils.getString(30078))
if(xbmcgui.Dialog().yesno(utils.getString(30077), utils.getString(30078), autoclose=15000)):
xbmc.executebuiltin('Quit')
return
# check if settings should be restored from this backup
@@ -347,6 +349,11 @@ class XbmcBackup:
# call update addons to refresh everything
xbmc.executebuiltin('UpdateLocalAddons')
# notify user that restart is recommended
if(xbmcgui.Dialog().yesno(utils.getString(30077), utils.getString(30078), autoclose=15000)):
xbmc.executebuiltin('Quit')
def _setupVFS(self, mode=-1, progressOverride=False):
# set windows setting to true
window = xbmcgui.Window(10000)
@@ -414,9 +421,9 @@ class XbmcBackup:
if(utils.getSettingBool('verbose_logging')):
utils.log('Writing file: ' + aFile['file'])
if(aFile['file'].startswith("-")):
if(aFile['is_dir']):
self._updateProgress('%s remaining\nwriting %s' % (utils.diskString(self.transferLeft), os.path.basename(aFile['file'][len(source.root_path):]) + "/"))
dest.mkdir(dest.root_path + aFile['file'][len(source.root_path) + 1:])
dest.mkdir(dest.root_path + aFile['file'][len(source.root_path):])
else:
self._updateProgress('%s remaining\nwriting %s' % (utils.diskString(self.transferLeft), os.path.basename(aFile['file'][len(source.root_path):])))
self.transferLeft = self.transferLeft - aFile['size']
@@ -426,6 +433,7 @@ class XbmcBackup:
# if result is still true but this file failed
if(not wroteFile and result):
utils.log("Failed to write " + aFile['file'])
result = False
return result
@@ -583,7 +591,7 @@ class FileManager:
def walk(self):
for aDir in self.root_dirs:
self.addFile('-' + xbmcvfs.translatePath(aDir['path']))
self.addFile(xbmcvfs.translatePath(aDir['path']), True)
self.walkTree(xbmcvfs.translatePath(aDir['path']), aDir['recurse'])
def walkTree(self, directory, recurse=True):
@@ -605,7 +613,7 @@ class FileManager:
# check if directory is excluded
if(not any(dirPath.startswith(exDir) for exDir in self.exclude_dir)):
self.addFile("-" + dirPath)
self.addFile(dirPath, True)
# catch for "non directory" type files
shouldWalk = True
@@ -628,7 +636,7 @@ class FileManager:
else:
self.excludeFile(xbmcvfs.translatePath(dirMeta['path']))
def addFile(self, filename):
def addFile(self, filename, is_dir = False):
# write the full remote path name of this file
if(utils.getSettingBool('verbose_logging')):
utils.log("Add File: " + filename)
@@ -637,7 +645,7 @@ class FileManager:
fSize = self.vfs.fileSize(filename)
self.totalSize = self.totalSize + fSize
self.fileArray.append({'file': filename, 'size': fSize})
self.fileArray.append({'file': filename, 'size': fSize, 'is_dir': is_dir})
def excludeFile(self, filename):
# remove trailing slash