From 1e38d3a8561050b42720149ef72d3f02c61d7ebf Mon Sep 17 00:00:00 2001 From: Phallacy Date: Sun, 3 Mar 2019 01:49:02 -0800 Subject: [PATCH] Added the files to build a dotnet template --- .../content/.template.config/template.json | 23 +++++ .../Configuration/PluginConfiguration.cs | 24 +++++ .../content/Configuration/configPage.html | 98 +++++++++++++++++++ dotnet-template/content/Plugin.cs | 35 +++++++ .../content/example-jellyfin-plugin.csproj | 21 ++++ .../example-jellyfin-plugin.nuspec | 14 +++ 6 files changed, 215 insertions(+) create mode 100644 dotnet-template/content/.template.config/template.json create mode 100644 dotnet-template/content/Configuration/PluginConfiguration.cs create mode 100644 dotnet-template/content/Configuration/configPage.html create mode 100644 dotnet-template/content/Plugin.cs create mode 100644 dotnet-template/content/example-jellyfin-plugin.csproj create mode 100644 dotnet-template/example-jellyfin-plugin.nuspec diff --git a/dotnet-template/content/.template.config/template.json b/dotnet-template/content/.template.config/template.json new file mode 100644 index 0000000..5f8778c --- /dev/null +++ b/dotnet-template/content/.template.config/template.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Jellyfin Team", + "classifications": [ "NetStandard", "Plugin", "Jellyfin" ], + "tags": { + "language": "C#", + "type":"project" + }, + "identity": "Jellyfin.Plugin", + "name": "Jellyfin Plugin template", + "shortName": "jellyfin-plugin", + "sourceName": "dotnet_template", + "symbols":{ + "pluginGuid":{ + "type": "generated", + "generator": "guid", + "replaces": "pluginguid", + "parameters": { + "format":"D" + } + } + } +} \ No newline at end of file diff --git a/dotnet-template/content/Configuration/PluginConfiguration.cs b/dotnet-template/content/Configuration/PluginConfiguration.cs new file mode 100644 index 0000000..de6c2fe --- /dev/null +++ b/dotnet-template/content/Configuration/PluginConfiguration.cs @@ -0,0 +1,24 @@ +using MediaBrowser.Model.Plugins; +namespace Jellyfin.Plugin.dotnet_template.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/dotnet-template/content/Configuration/configPage.html b/dotnet-template/content/Configuration/configPage.html new file mode 100644 index 0000000..ec3beeb --- /dev/null +++ b/dotnet-template/content/Configuration/configPage.html @@ -0,0 +1,98 @@ + + + + + + dotnet_template Configuration + + +
+
+
+ +
+
+ + +
+
+ + +
Numbers go here
+
+
+ +
+
+ + +
Words go here
+
+
+ +
+
+
+
+ + +
+ + \ No newline at end of file diff --git a/dotnet-template/content/Plugin.cs b/dotnet-template/content/Plugin.cs new file mode 100644 index 0000000..4390e0c --- /dev/null +++ b/dotnet-template/content/Plugin.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using Jellyfin.Plugin.dotnet_template.Configuration; +using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Plugins; +using MediaBrowser.Model.Plugins; +using MediaBrowser.Model.Serialization; + +namespace Jellyfin.Plugin.dotnet_template +{ + public class Plugin : BasePlugin, + IHasWebPages + { + public override string Name => "dotnet_template"; + public override Guid Id => Guid.Parse("pluginguid"); + 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/dotnet-template/content/example-jellyfin-plugin.csproj b/dotnet-template/content/example-jellyfin-plugin.csproj new file mode 100644 index 0000000..9a39703 --- /dev/null +++ b/dotnet-template/content/example-jellyfin-plugin.csproj @@ -0,0 +1,21 @@ + + + + netstandard2.0 + Jellyfin.Plugin.dotnet_template + + + + + + + + + + + + + + + + diff --git a/dotnet-template/example-jellyfin-plugin.nuspec b/dotnet-template/example-jellyfin-plugin.nuspec new file mode 100644 index 0000000..f4a6742 --- /dev/null +++ b/dotnet-template/example-jellyfin-plugin.nuspec @@ -0,0 +1,14 @@ + + + + Jellyfin.Plugin + 1.0.0 + + A template to create a new Jellyfin plugin. + + Jellyfin Team + + + + + \ No newline at end of file