mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-12-22 14:05:23 +01:00
part of #185
This commit is contained in:
parent
4c4e4a74ab
commit
8f4a7b5895
@ -495,7 +495,7 @@ class XbmcBackup:
|
|||||||
remove_num = remove_num + 1
|
remove_num = remove_num + 1
|
||||||
|
|
||||||
def _createValidationFile(self, dirList):
|
def _createValidationFile(self, dirList):
|
||||||
valInfo = {"name": "XBMC Backup Validation File", "xbmc_version": xbmc.getInfoLabel('System.BuildVersion'), "type": 0, "system_settings": []}
|
valInfo = {"name": "XBMC Backup Validation File", "xbmc_version": xbmc.getInfoLabel('System.BuildVersion'), "type": 0, "system_settings": [], "addons": []}
|
||||||
valDirs = []
|
valDirs = []
|
||||||
|
|
||||||
# save list of file sets
|
# save list of file sets
|
||||||
@ -507,6 +507,9 @@ class XbmcBackup:
|
|||||||
gui_settings = GuiSettingsManager()
|
gui_settings = GuiSettingsManager()
|
||||||
valInfo['system_settings'] = gui_settings.backup()
|
valInfo['system_settings'] = gui_settings.backup()
|
||||||
|
|
||||||
|
# save all currently installed addons
|
||||||
|
valInfo['addons'] = gui_settings.list_addons()
|
||||||
|
|
||||||
vFile = xbmcvfs.File(xbmcvfs.translatePath(utils.data_dir() + "xbmcbackup.val"), 'w')
|
vFile = xbmcvfs.File(xbmcvfs.translatePath(utils.data_dir() + "xbmcbackup.val"), 'w')
|
||||||
vFile.write(json.dumps(valInfo))
|
vFile.write(json.dumps(valInfo))
|
||||||
vFile.write("")
|
vFile.write("")
|
||||||
|
@ -13,6 +13,12 @@ class GuiSettingsManager:
|
|||||||
|
|
||||||
self.systemSettings = json_response['result']['settings']
|
self.systemSettings = json_response['result']['settings']
|
||||||
|
|
||||||
|
def list_addons(self):
|
||||||
|
# list all currently installed addons
|
||||||
|
addons = json.loads(xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Addons.GetAddons", "params":{"properties":["version","author"]}, "id":2}'))
|
||||||
|
|
||||||
|
return addons['result']['addons']
|
||||||
|
|
||||||
def backup(self):
|
def backup(self):
|
||||||
utils.log('Backing up Kodi settings')
|
utils.log('Backing up Kodi settings')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user