From ea89b92414ee7bea817937e52a90943ac502be13 Mon Sep 17 00:00:00 2001 From: Phallacy Date: Thu, 21 Feb 2019 01:57:43 -0800 Subject: [PATCH] Example Plugin project added --- .../Configuration/PluginConfiguration.cs | 24 +++++ example-plugin/Configuration/configPage.html | 98 +++++++++++++++++++ example-plugin/Plugin.cs | 35 +++++++ example-plugin/example-jellyfin-plugin.csproj | 21 ++++ 4 files changed, 178 insertions(+) create mode 100644 example-plugin/Configuration/PluginConfiguration.cs create mode 100644 example-plugin/Configuration/configPage.html create mode 100644 example-plugin/Plugin.cs create mode 100644 example-plugin/example-jellyfin-plugin.csproj diff --git a/example-plugin/Configuration/PluginConfiguration.cs b/example-plugin/Configuration/PluginConfiguration.cs new file mode 100644 index 0000000..04175e5 --- /dev/null +++ b/example-plugin/Configuration/PluginConfiguration.cs @@ -0,0 +1,24 @@ +using MediaBrowser.Model.Plugins; +namespace Jellyfin.Plugin.ExamplePlugin.Configuration +{ + public enum SomeOptions + { + OneOption, + AnotherOption + } + public class PluginConfiguration : BasePluginConfiguration + { + //This is where you should 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() + { + Options = SomeOptions.AnotherOption; + TrueFalseSetting = true; + AnInteger = 5; + AString = "This is a string setting"; + } + } +} \ No newline at end of file diff --git a/example-plugin/Configuration/configPage.html b/example-plugin/Configuration/configPage.html new file mode 100644 index 0000000..c94a318 --- /dev/null +++ b/example-plugin/Configuration/configPage.html @@ -0,0 +1,98 @@ + + + + + + ExamplePlugin Configuration + + +
+
+
+ +
+
+ + +
+
+ + +
Numbers go here
+
+
+ +
+
+ + +
Words go here
+
+
+ +
+
+
+
+ + +
+ + \ No newline at end of file diff --git a/example-plugin/Plugin.cs b/example-plugin/Plugin.cs new file mode 100644 index 0000000..b2e1010 --- /dev/null +++ b/example-plugin/Plugin.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using Jellyfin.Plugin.ExamplePlugin.Configuration; +using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Plugins; +using MediaBrowser.Model.Plugins; +using MediaBrowser.Model.Serialization; + +namespace Jellyfin.Plugin.ExamplePlugin +{ + public class Plugin : BasePlugin, + IHasWebPages + { + public override string Name => "ExamplePlugin"; + public override Guid Id => Guid.Parse("eb5d7894-8eef-4b36-aa6f-5d124e828ce1"); + public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) : base(applicationPaths, xmlSerializer) + { + Instance = this; + } + + public static Plugin Instance { get; private set; } + + public IEnumerable GetPages() + { + return new[] + { + new PluginPageInfo + { + Name = this.Name, + EmbeddedResourcePath = string.Format("Jellyfin.Plugin.{0}.Configuration.configPage.html",this.Name) + } + }; + } + } +} \ No newline at end of file diff --git a/example-plugin/example-jellyfin-plugin.csproj b/example-plugin/example-jellyfin-plugin.csproj new file mode 100644 index 0000000..75156a9 --- /dev/null +++ b/example-plugin/example-jellyfin-plugin.csproj @@ -0,0 +1,21 @@ + + + + netstandard2.0 + Jellyfin.Plugin.ExamplePlugin + + + + + + + + + + + + + + + +