readme changes

This commit is contained in:
dkanada 2021-01-10 20:23:01 +09:00 committed by GitHub
parent aceab47fab
commit ee82d22666
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,11 +8,11 @@ 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 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)
## 0.5. Quickstarts
@ -32,14 +32,14 @@ We have a number of quickstart options available to speed you along the way.
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 one. 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
Make a new dotnet standard project with the following command, it will make a directory for itself:
Make a new dotnet standard project with the following command, it will make a directory for itself.
```
dotnet new classlib -f net5.0 -n MyJellyFinPlugin
dotnet new classlib -f net5.0 -n MyJellyfinPlugin
```
Now add the Jellyfin shared libraries.
@ -49,17 +49,17 @@ dotnet add package Jellyfin.Model
dotnet add package Jellyfin.Controller
```
You have an autogenerated Class1.cs file, you won't be needing this, so go ahead and delete it.
You have an autogenerated Class1.cs file. You won't be needing this, so go ahead and delete it.
## 2. Setup Basics
## 2. Set Up the Basics
There are a few mandatory classes you'll need for a plugin so we need to make them.
### Make a new class called PluginConfiguration
### PluginConfiguration
You can call it whatever you'd like really. 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
### 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> `
@ -69,7 +69,7 @@ Note: If you called your PluginConfiguration class something different, you need
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 section.
```c#
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) : base(applicationPaths, xmlSerializer){}
@ -80,7 +80,9 @@ public override Guid Id => Guid.Parse("");
## 3. Customize Plugin Information
You need to populate some of your plugin's information. Go ahead a put in a string of the Name you've overridden name, and generate a GUID
- **Windows Users**: you can use the Powershell command `New-Guid`, `[guid]::NewGuid()` or the Visual Studio GUID generator
- **Linux and OS X Users**: you can use the Powershell Core command `New-Guid` or this command from your shell of choice:
```bash
@ -100,7 +102,7 @@ Congratulations, you now have everything you need for a perfectly functional fun
Most people aren't satisfied with just having an entry in a menu for their plugin, most people want to have some functionality, so lets look at how to add it.
### 4a. Implement interfaces to add components
### 4a. Implement Interfaces
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.
@ -146,11 +148,11 @@ Likewise you might need to get data and services from the Jellyfin core, Jellyfi
- **IXmlSerializer** - Allows you to use the main xml serializer
- **IZipClient** - Allows you to use the core zip client for compressing and decompressing data
## 5. Create a Repo
## 5. Create a Repository
- [See blog post](https://jellyfin.org/posts/plugin-updates/)
## A note about licensing
## Licensing
Licensing is a complex topic. This repository features a GPLv3 license template that can be used to provide a good default license for your plugin. You may alter this if you like, but if you do a permissive license must be chosen.