From 8f4a7b589591738686839b65bd9d3746f9e1404b Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Wed, 5 Apr 2023 11:46:18 -0500 Subject: [PATCH] part of #185 --- resources/lib/backup.py | 5 ++++- resources/lib/guisettings.py | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/lib/backup.py b/resources/lib/backup.py index e7cf95d..d05be95 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -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("") diff --git a/resources/lib/guisettings.py b/resources/lib/guisettings.py index 8fe3def..2f9aaa1 100644 --- a/resources/lib/guisettings.py +++ b/resources/lib/guisettings.py @@ -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')