Merge pull request #14 from nielsvanvelzen/net31jf105
Update to .NET 2.1 and Jellyfin 10.5
This commit is contained in:
commit
d623136439
@ -1,23 +1,23 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.1</TargetFramework>
|
||||||
<RootNamespace>Jellyfin.Plugin.Template</RootNamespace>
|
<RootNamespace>Jellyfin.Plugin.Template</RootNamespace>
|
||||||
<AssemblyVersion>7.0.0</AssemblyVersion>
|
<AssemblyVersion>7.0.0</AssemblyVersion>
|
||||||
<FileVersion>7.0.0</FileVersion>
|
<FileVersion>7.0.0</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Jellyfin.Controller" Version="10.*" />
|
<PackageReference Include="Jellyfin.Controller" Version="10.5.*" />
|
||||||
<PackageReference Include="Jellyfin.Model" Version="10.*" />
|
<PackageReference Include="Jellyfin.Model" Version="10.5.*" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Configuration\configPage.html" />
|
<None Remove="Configuration\configPage.html" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Configuration\configPage.html" />
|
<EmbeddedResource Include="Configuration\configPage.html" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
26
README.md
26
README.md
@ -1,6 +1,6 @@
|
|||||||
# So you want to make a Jellyfin plugin
|
# 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:
|
## 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:
|
- An editor of your choice. Some free choices are:
|
||||||
|
|
||||||
[Visual Studio Code](https://code.visualstudio.com/)
|
[Visual Studio Code](https://code.visualstudio.com/)
|
||||||
|
|
||||||
[Visual Studio Community Edition](https://visualstudio.microsoft.com/downloads/)
|
[Visual Studio Community Edition](https://visualstudio.microsoft.com/downloads/)
|
||||||
|
|
||||||
[Mono Develop](https://www.monodevelop.com/)
|
[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
|
- Run this command then skip to step 4
|
||||||
|
|
||||||
```
|
```
|
||||||
dotnet new Jellyfin-plugin -name MyPlugin
|
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
|
## 1. Initialize your project
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ dotnet new classlib -f netstandard2.0 -n MyJellyFinPlugin
|
|||||||
```
|
```
|
||||||
|
|
||||||
Now add the Jellyfin shared libraries.
|
Now add the Jellyfin shared libraries.
|
||||||
|
|
||||||
```
|
```
|
||||||
dotnet add package Jellyfin.Model
|
dotnet add package Jellyfin.Model
|
||||||
dotnet add package Jellyfin.Controller
|
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.
|
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`
|
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> `
|
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 <>
|
Note: If you called your PluginConfiguration class something different, you need to put that between the <>
|
||||||
|
|
||||||
### Implement Required Properties
|
### 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:
|
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.
|
- 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.
|
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
|
### 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:
|
Here's some interfaces you could implement for common use cases:
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name: "jellyfin-plugin-template"
|
name: "jellyfin-plugin-template"
|
||||||
guid: "eb5d7894-8eef-4b36-aa6f-5d124e828ce1"
|
guid: "eb5d7894-8eef-4b36-aa6f-5d124e828ce1"
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
jellyfin_version: "10.3.7"
|
jellyfin_version: "10.5.0"
|
||||||
nicename: "Template"
|
nicename: "Template"
|
||||||
description: "Short description about your plugin"
|
description: "Short description about your plugin"
|
||||||
overview: >
|
overview: >
|
||||||
@ -14,4 +14,4 @@ artifacts:
|
|||||||
- "Jellyfin.Plugin.Template.dll"
|
- "Jellyfin.Plugin.Template.dll"
|
||||||
build_type: "dotnet"
|
build_type: "dotnet"
|
||||||
dotnet_configuration: "Release"
|
dotnet_configuration: "Release"
|
||||||
dotnet_framework: "netstandard2.0"
|
dotnet_framework: "netstandard2.1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user