About
As you're no doubt aware some add-ons have many different settings available and unless configured correctly the user could end up with a number of issues. This in turn can cause quite a support headache as you can never be sure just what settings the user has setup, well we have a solution for that...
Force Settings (discouraged):
If you want to force specific settings on all your devices and not allow the user to change them you could use the "Sync Center -> Individual Files" option and upload your relevant addon_data/addon_name/settings.xml file. Whilst this will work it's not necessarily what we would recommend, it would mean all your customers are locked to those specific settings - every attempt at changing them would work for a while but then when the software checks our servers for updates it will notice the settings have changed and overwrite them again. Some add-ons will be fine for this and some will not, for example you may well have an add-on which requires unique individual user logins. You can't keep overwriting these settings as the user would then need to keep entering their login information every time they want to use the add-on!
Editing Default Settings (The WRONG way!):
Using the same method you could edit the actual add-ons default settings file (addons/addon_name/resources/settings.xml). Initially it may sound like an ideal solution, it still allows the user to make their custom changes to the add-on settings but if they mess it up they can click on the "default" button in settings and it will revert to whatever your defaults were in the settings.xml file. In practise it's often not as straight forward as that... What happens when a developer updates their add-on and they add new items to the the settings.xml file? As you're getting the system to overwrite this file with an older settings file there's a very good chance it will break the whole add-on and you'll be left scratching your head wondering why it's working for others but not your devices! Well fear not we have a great solution for that...
Editing Default Settings (The CORRECT way!):
We've created a solution where the system can dynamically amend the default add-on settings file without the need to fully overwrite and potentially break the add-on. There is a little work on your behalf but it should relatively straight forward and should only take a couple of minutes:
- In Kodi (preferably on your PC) configure the add-on settings to however you want the defaults to be.
- In a text editor such as Sublime open the settings.xml file (userdata/addon_data/addon_name/settings.xml), make sure it's this location and not the settings.xml found in the addons folder.
- This file contains each of the settings on a separate line, remove every line that isn't one of the settings you changed and then save the file.
- In admin panel go to Sync Center -> Add-on Settings
- Click on "Add a custom item"
- Enter a description and title, this is for your use only so can be whatever you want. It would of course make sense to name it the same as the add-on though.
- Now for the very important bit... enter the addon_id. By default the example text is set to plugin.video.youtube but edit this so it matches your add-on. Double check you've not got any typos in there and remember it is case sensitive - it must match the exact name of the addon_id (this can be found by opening addons/addon_name/addon.xml).
- You will now have an option to upload a file so this is where you upload your newly saved settings.xml file you created.
Congratulations, those settings will now become the defaults!
No matter how many times the add-on updates or if the developer changes the settings.xml file your default settings will always be merged. This can be extremely useful for supporting your customers, it still gives them the freedom to edit settings for their needs but if they have a problem they just hit the default button and it will revert back to your defaults and not the add-on developers defaults.
Can I just upload the whole settings.xml without removing lines?
The short answer is yes, however we would encourage you to only include the settings you want to alter. The main reason for this is there may well be hidden settings in that file which as a user you don't get to see, the developer may setup some values in here which the add-on relies on and by default they are hidden. It may be in their next update they need to alter these settings so ideally you only want to include the settings which you're 100% you want to change.
Creating your own default settings for add-ons: