This commit is contained in:
Rob Weber 2023-04-05 11:46:18 -05:00
parent 4c4e4a74ab
commit 8f4a7b5895
2 changed files with 10 additions and 1 deletions

View File

@ -495,7 +495,7 @@ class XbmcBackup:
remove_num = remove_num + 1
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 = []
# save list of file sets
@ -507,6 +507,9 @@ class XbmcBackup:
gui_settings = GuiSettingsManager()
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.write(json.dumps(valInfo))
vFile.write("")

View File

@ -13,6 +13,12 @@ class GuiSettingsManager:
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):
utils.log('Backing up Kodi settings')