From 788a47edb09a6635b94c05a42a19a7d9367c648f Mon Sep 17 00:00:00 2001 From: dkanada Date: Wed, 27 Nov 2019 03:13:09 +0900 Subject: [PATCH] fix runtime error and add a few comments --- Jellyfin.Plugin.Template/.editorconfig => .editorconfig | 0 .../Configuration/PluginConfiguration.cs | 9 ++++++--- Jellyfin.Plugin.Template/Configuration/configPage.html | 4 ++-- Jellyfin.Plugin.Template/Jellyfin.Plugin.Template.csproj | 4 ++-- Jellyfin.Plugin.Template/Plugin.cs | 2 ++ 5 files changed, 12 insertions(+), 7 deletions(-) rename Jellyfin.Plugin.Template/.editorconfig => .editorconfig (100%) diff --git a/Jellyfin.Plugin.Template/.editorconfig b/.editorconfig similarity index 100% rename from Jellyfin.Plugin.Template/.editorconfig rename to .editorconfig diff --git a/Jellyfin.Plugin.Template/Configuration/PluginConfiguration.cs b/Jellyfin.Plugin.Template/Configuration/PluginConfiguration.cs index 3c38058..5ea6277 100644 --- a/Jellyfin.Plugin.Template/Configuration/PluginConfiguration.cs +++ b/Jellyfin.Plugin.Template/Configuration/PluginConfiguration.cs @@ -7,19 +7,22 @@ namespace Jellyfin.Plugin.Template.Configuration OneOption, AnotherOption } + public class PluginConfiguration : BasePluginConfiguration { - //This is where you should store configurable settings your plugin might need. + // store configurable settings your plugin might need public bool TrueFalseSetting { get; set; } public int AnInteger { get; set; } public string AString { get; set; } public SomeOptions Options { get; set; } + public PluginConfiguration() { + // set default options here Options = SomeOptions.AnotherOption; TrueFalseSetting = true; - AnInteger = 5; - AString = "This is a string setting"; + AnInteger = 2; + AString = "string"; } } } diff --git a/Jellyfin.Plugin.Template/Configuration/configPage.html b/Jellyfin.Plugin.Template/Configuration/configPage.html index e6166b1..a6f18ff 100644 --- a/Jellyfin.Plugin.Template/Configuration/configPage.html +++ b/Jellyfin.Plugin.Template/Configuration/configPage.html @@ -1,7 +1,7 @@ - + Template @@ -63,7 +63,7 @@ config.AnInteger = $('#AnInteger').val(); config.TrueFalseSetting = $('#TrueFalseSetting').prop('checked'); config.AString = $('#AString').val(); - ApiClient.updatePluginConfiguration(ExamplePluginConfigurationPage.pluginUniqueId, config).then(function (result) { + ApiClient.updatePluginConfiguration(TemplateConfig.pluginUniqueId, config).then(function (result) { Dashboard.processPluginConfigurationUpdateResult(result); }); }); diff --git a/Jellyfin.Plugin.Template/Jellyfin.Plugin.Template.csproj b/Jellyfin.Plugin.Template/Jellyfin.Plugin.Template.csproj index 3deeace..430f409 100644 --- a/Jellyfin.Plugin.Template/Jellyfin.Plugin.Template.csproj +++ b/Jellyfin.Plugin.Template/Jellyfin.Plugin.Template.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/Jellyfin.Plugin.Template/Plugin.cs b/Jellyfin.Plugin.Template/Plugin.cs index bec92e2..74ead75 100644 --- a/Jellyfin.Plugin.Template/Plugin.cs +++ b/Jellyfin.Plugin.Template/Plugin.cs @@ -11,7 +11,9 @@ namespace Jellyfin.Plugin.Template public class Plugin : BasePlugin, IHasWebPages { public override string Name => "Template"; + public override Guid Id => Guid.Parse("eb5d7894-8eef-4b36-aa6f-5d124e828ce1"); + public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) : base(applicationPaths, xmlSerializer) { Instance = this;