fixes per enen92

This commit is contained in:
Rob Weber 2019-12-04 11:31:00 -06:00
parent 16e13c7d80
commit 5e2d099448
7 changed files with 16 additions and 19 deletions

View File

@ -80,12 +80,10 @@
<description lang="sk_SK">Už ste niekedy poškodili konfiguráciu Kodi a priali si mať zálohu? Teraz môžete - na jeden klik. Môžete exportovať Vašu databázu, playlist, náhľady, doplnky a konfigurácie na ktorýkoľvek zdroj zapisovateľný Kodi. Zálohy môžu byť púšťané na požiadanie alebo plánovačom. </description> <description lang="sk_SK">Už ste niekedy poškodili konfiguráciu Kodi a priali si mať zálohu? Teraz môžete - na jeden klik. Môžete exportovať Vašu databázu, playlist, náhľady, doplnky a konfigurácie na ktorýkoľvek zdroj zapisovateľný Kodi. Zálohy môžu byť púšťané na požiadanie alebo plánovačom. </description>
<description lang="sv_SE">Har du någonsin tappat bort din Kodi konfiguration och önskat att du hade en backup? Nu kan du enkelt med ett klick. Du kan exportera din databas, spellista, minityrer, tillägg och andra konfigurationsdetaljer till valfri källa som är skrivbar för Kodi. Backupper kan köras på begäran eller via scheman.</description> <description lang="sv_SE">Har du någonsin tappat bort din Kodi konfiguration och önskat att du hade en backup? Nu kan du enkelt med ett klick. Du kan exportera din databas, spellista, minityrer, tillägg och andra konfigurationsdetaljer till valfri källa som är skrivbar för Kodi. Backupper kan köras på begäran eller via scheman.</description>
<description lang="zh_CN">你是否经常折腾你的 Kodi因而希望能够有个备份你可以把资料库、播放列表、缩略图、插件和其他配置细节导出到 Kodi 可以写入的任意位置。备份可以按需运行或通过计划任务执行。</description> <description lang="zh_CN">你是否经常折腾你的 Kodi因而希望能够有个备份你可以把资料库、播放列表、缩略图、插件和其他配置细节导出到 Kodi 可以写入的任意位置。备份可以按需运行或通过计划任务执行。</description>
<language></language>
<platform>all</platform> <platform>all</platform>
<license>The MIT License</license> <license>MIT</license>
<forum>https://forum.kodi.tv/showthread.php?tid=129499</forum> <forum>https://forum.kodi.tv/showthread.php?tid=129499</forum>
<source>https://github.com/robweber/xbmcbackup</source> <source>https://github.com/robweber/xbmcbackup</source>
<email></email>
<assets> <assets>
<icon>resources/images/icon.png</icon> <icon>resources/images/icon.png</icon>
<screenshot>resources/images/screenshot1.png</screenshot> <screenshot>resources/images/screenshot1.png</screenshot>
@ -93,10 +91,11 @@
<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.2 <news>Version 1.6.0
- Added script.module.dropbox import as a dependency for Dropbox filesystem - Backups/Restores now use the concept of a Set to define groups of related files. Restores can restore one set or all sets within a backup archive (no more all or nothing restores)
- 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. - Added a new Advanced Editor script for more dynamic included/excluded directories based on a JSON formatted file
- 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 - Fixed guisettings restores
- Removed GoogleDrive support - Python 3 compatibility was an issue
</news> </news>
</extension> </extension>
</addon> </addon>

View File

@ -1,4 +1,3 @@
import sys
import xbmc import xbmc
import xbmcgui import xbmcgui
import resources.lib.utils as utils import resources.lib.utils as utils

View File

View File

@ -2,6 +2,7 @@ import json
import xbmc import xbmc
import xbmcgui import xbmcgui
import xbmcvfs import xbmcvfs
import os.path
from . import utils as utils from . import utils as utils
@ -180,14 +181,14 @@ class AdvancedBackupEditor:
while(exitCondition != -1): while(exitCondition != -1):
# load the custom paths # load the custom paths
listItem = xbmcgui.ListItem(utils.getString(30126), '') listItem = xbmcgui.ListItem(utils.getString(30126), '')
listItem.setArt({'icon': utils.addon_dir() + 'resources/images/plus-icon.png'}) listItem.setArt({'icon': os.path.join(utils.addon_dir(),'resources','images','plus-icon.png')})
options = [listItem] options = [listItem]
for index in range(0, len(customPaths.getSets())): for index in range(0, len(customPaths.getSets())):
aSet = customPaths.getSet(index) aSet = customPaths.getSet(index)
listItem = xbmcgui.ListItem(aSet['name'], utils.getString(30121) + ': ' + aSet['set']['root']) listItem = xbmcgui.ListItem(aSet['name'], utils.getString(30121) + ': ' + aSet['set']['root'])
listItem.setArt({'icon': utils.addon_dir() + 'resources/images/folder-icon.png'}) listItem.setArt({'icon': os.path.join(utils.addon_dir(),'resources','images','folder-icon.png')})
options.append(listItem) options.append(listItem)
# show the gui # show the gui
@ -226,7 +227,7 @@ class AdvancedBackupEditor:
shouldContinue = self.dialog.yesno(utils.getString(30139), utils.getString(30140), utils.getString(30141)) shouldContinue = self.dialog.yesno(utils.getString(30139), utils.getString(30140), utils.getString(30141))
if(shouldContinue): if(shouldContinue):
source = xbmc.translatePath(utils.addon_dir() + "/resources/data/default_files.json") source = xbmc.translatePath(os.path.join(utils.addon_dir(),'resources','data','default_files.json'))
dest = xbmc.translatePath(utils.data_dir() + "/custom_paths.json") dest = xbmc.translatePath(os.path.join(utils.data_dir(),'custom_paths.json'))
xbmcvfs.copy(source, dest) xbmcvfs.copy(source, dest)

View File

@ -522,14 +522,12 @@ class XbmcBackup:
return result return result
def _createResumeBackupFile(self): def _createResumeBackupFile(self):
rFile = xbmcvfs.File(xbmc.translatePath(utils.data_dir() + "resume.txt"), 'w') with xbmcvfs.File(xbmc.translatePath(utils.data_dir() + "resume.txt"), 'w') as f:
rFile.write(self.restore_point) f.write(self.restore_point)
rFile.close()
def _readBackupConfig(self, aFile): def _readBackupConfig(self, aFile):
jFile = xbmcvfs.File(xbmc.translatePath(aFile), 'r') with xbmcvfs.File(xbmc.translatePath(aFile), 'r') as f:
jsonString = jFile.read() jsonString = f.read()
jFile.close()
return json.loads(jsonString) return json.loads(jsonString)

View File

@ -9,4 +9,4 @@ def shorten(aUrl):
data = req.read() data = req.read()
# should be a tiny url # should be a tiny url
return str(data) return data