Merge pull request #14 from nielsvanvelzen/net31jf105

Update to .NET 2.1 and Jellyfin 10.5
This commit is contained in:
Anthony Lavado 2020-03-10 09:57:24 -04:00 committed by GitHub
commit d623136439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 38 deletions

View File

@ -1,23 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>Jellyfin.Plugin.Template</RootNamespace>
<AssemblyVersion>7.0.0</AssemblyVersion>
<FileVersion>7.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jellyfin.Controller" Version="10.*" />
<PackageReference Include="Jellyfin.Model" Version="10.*" />
</ItemGroup>
<ItemGroup>
<None Remove="Configuration\configPage.html" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Configuration\configPage.html" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RootNamespace>Jellyfin.Plugin.Template</RootNamespace>
<AssemblyVersion>7.0.0</AssemblyVersion>
<FileVersion>7.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jellyfin.Controller" Version="10.5.*" />
<PackageReference Include="Jellyfin.Model" Version="10.5.*" />
</ItemGroup>
<ItemGroup>
<None Remove="Configuration\configPage.html" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Configuration\configPage.html" />
</ItemGroup>
</Project>

View File

@ -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<PluginConfiguration> `
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:

View File

@ -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"