From 126a0eb6b63aa7e170f974ebaf0b0d96638e53bc Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Mon, 9 Mar 2020 21:17:32 +0100 Subject: [PATCH] Update to .NET 2.1 and Jellyfin 10.5 --- .../Jellyfin.Plugin.Template.csproj | 46 +++++++++---------- README.md | 26 +++++------ build.yaml | 4 +- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Jellyfin.Plugin.Template/Jellyfin.Plugin.Template.csproj b/Jellyfin.Plugin.Template/Jellyfin.Plugin.Template.csproj index 8e7b418..3931f3a 100644 --- a/Jellyfin.Plugin.Template/Jellyfin.Plugin.Template.csproj +++ b/Jellyfin.Plugin.Template/Jellyfin.Plugin.Template.csproj @@ -1,23 +1,23 @@ - - - - netstandard2.0 - Jellyfin.Plugin.Template - 7.0.0 - 7.0.0 - - - - - - - - - - - - - - - - + + + + netstandard2.1 + Jellyfin.Plugin.Template + 7.0.0 + 7.0.0 + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 1337be8..bf6a631 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # So you want to make a Jellyfin plugin -Awesome! This guide is for you. Jellyfin plugins are written using the dotnet standard framework. What that means is you can write them in any language that implements the CLI or the DLI and can compile to netstandard2.0. The examples on this page are in C# because that is what most of Jellyfin is written in, but F#, Visual Basic, and IronPython should all be compatible once compiled. +Awesome! This guide is for you. Jellyfin plugins are written using the dotnet standard framework. What that means is you can write them in any language that implements the CLI or the DLI and can compile to netstandard2.1. The examples on this page are in C# because that is what most of Jellyfin is written in, but F#, Visual Basic, and IronPython should all be compatible once compiled. ## 0. Things you need to get started: @@ -8,7 +8,7 @@ Awesome! This guide is for you. Jellyfin plugins are written using the dotnet st - An editor of your choice. Some free choices are: [Visual Studio Code](https://code.visualstudio.com/) - + [Visual Studio Community Edition](https://visualstudio.microsoft.com/downloads/) [Mono Develop](https://www.monodevelop.com/) @@ -26,12 +26,12 @@ We have a number of quickstart options available to speed you along the way ``` - Run this command then skip to step 4 - + ``` dotnet new Jellyfin-plugin -name MyPlugin ``` -If you'd rather start from scratch keep going on to step 1. This assumes no specific editor or IDE and requires only the command line with dotnet in the path. +If you'd rather start from scratch keep going on to step 1. This assumes no specific editor or IDE and requires only the command line with dotnet in the path. ## 1. Initialize your project @@ -42,7 +42,7 @@ dotnet new classlib -f netstandard2.0 -n MyJellyFinPlugin ``` Now add the Jellyfin shared libraries. - + ``` dotnet add package Jellyfin.Model dotnet add package Jellyfin.Controller @@ -54,19 +54,19 @@ You have an autogenerated Class1.cs file, you won't be needing this, so go ahead There are a few mandatory classes you'll need for a plugin so we need to make them. -### Make a new class called PluginConfiguration +### Make a new class called PluginConfiguration You can call it watever you'd like readlly. This class is used to hold settings your plugin might need. We can leave it empty for now. This class should inherit from `MediaBrowser.Model.Plugins.BasePluginConfiguration` - -### Make a new class called Plugin + +### Make a new class called Plugin This is the main class for your plugin. It will define your name, version and Id. It should inherit from `MediaBrowser.Common.Plugins.BasePlugin ` - + Note: If you called your PluginConfiguration class something different, you need to put that between the <> - + ### Implement Required Properties -The Plugin class needs a few properties implemented before it can work correctly. +The Plugin class needs a few properties implemented before it can work correctly. It needs an override on ID, an override on Name and a constructor that follows a specific model. To get started you can use the following snippit: @@ -87,7 +87,7 @@ You need to populate some of your plugin's information. Go ahead a put in a stri ``` - Place that guid inside the `Guid.Parse("")` quotes to define your plugin's ID. -## 4. Adding Functionality +## 4. Adding Functionality Congratulations, you now have everything you need for a perfectly functional functionless Jellyfin plugin! You can try it out right now if you'd like by compiling it, then placing the dll you generate in the plugins folder under your Jellyfin config directory. If you want to try and hook it up to a debugger make sure you copy the generated PDB file alongside it. @@ -95,7 +95,7 @@ Most people aren't satisfied with just having an entry in a menu for their plugi ### 4a. Implement interfaces to add components -If the functionality you are trying to add is functionality related to something that Jellyfin has an interface for you're in luck. Jellyfin uses some automatic discovery and injection to allow any interfaces you implement in your plugin to be available in Jellyfin. +If the functionality you are trying to add is functionality related to something that Jellyfin has an interface for you're in luck. Jellyfin uses some automatic discovery and injection to allow any interfaces you implement in your plugin to be available in Jellyfin. Here's some interfaces you could implement for common use cases: diff --git a/build.yaml b/build.yaml index 7320656..97aec09 100644 --- a/build.yaml +++ b/build.yaml @@ -2,7 +2,7 @@ name: "jellyfin-plugin-template" guid: "eb5d7894-8eef-4b36-aa6f-5d124e828ce1" version: "1.0.0" -jellyfin_version: "10.3.7" +jellyfin_version: "10.5.0" nicename: "Template" description: "Short description about your plugin" overview: > @@ -14,4 +14,4 @@ artifacts: - "Jellyfin.Plugin.Template.dll" build_type: "dotnet" dotnet_configuration: "Release" -dotnet_framework: "netstandard2.0" +dotnet_framework: "netstandard2.1"