VicMoore 560 Posted December 2, 2023 Share Posted December 2, 2023 Good morning... I am trying to use: ApiClient.getPluginConfiguration(pluginId).then(async function (config) { } where pluginId is the GUID from the plugin, to save my plugins configuration. I can't get it to work. I set up my plugin.cs as follows: public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages, IHasThumbImage, IHasTranslations { public static Plugin Instance { get; set; } public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) : base(applicationPaths, xmlSerializer) { Instance = this; } Next I added PluginConfiguration.cs namespace VirtualTVExample { public class PluginConfiguration : BasePluginConfiguration { public PluginConfiguration() { } } } Then I tested the javascript code as follows: ApiClient.getPluginConfiguration(pluginId).then(async function (config) { console.log("===== get plugin configuration, config = ", config); config.tunerHostChannels = tunerHostChannels; // <-------<<<< ApiClient.updatePluginConfiguration(pluginId, config).then((r) => { console.log("===== save plugin config, r = " + r + ", config = ", config); }); }); After executing the code above several times, the getPluginConfiguration code never returns anything. What am I doing wrong? Vic Link to comment Share on other sites More sharing options...
VicMoore 560 Posted December 2, 2023 Author Share Posted December 2, 2023 I answered my own question -- sometimes I am a bit slow Vic Link to comment Share on other sites More sharing options...
Luke 37094 Posted December 2, 2023 Share Posted December 2, 2023 It sounds as if you're diverting away from the example that I've given you. If you follow what i gave you, then you don't need to use plugin configuration. You can add any settings you wish to the tuner config. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now