diff --git a/README.md b/README.md index fa7fce6..cedfae9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Awesome! This guide is for you. Jellyfin plugins are written using the dotnet st ## 0. Things you need to get started -- [Dotnet SDK 8.0](https://dotnet.microsoft.com/download) +- [Dotnet SDK 9.0](https://dotnet.microsoft.com/en-us/download/dotnet) - An editor of your choice. Some free choices are: @@ -39,7 +39,7 @@ If you'd rather start from scratch keep going on to step one. This assumes no sp Make a new dotnet standard project with the following command, it will make a directory for itself. ``` -dotnet new classlib -f net8.0 -n MyJellyfinPlugin +dotnet new classlib -f net9.0 -n MyJellyfinPlugin ``` Now add the Jellyfin shared libraries. @@ -51,17 +51,57 @@ dotnet add package Jellyfin.Controller You have an autogenerated Class1.cs file. You won't be needing this, so go ahead and delete it. +Navigate to the csproj that was generated, and ensure that you modify the package references to exclude assets, so that unnecessary files aren't copied over. +Skipping this step will prevent your plugin from registering correctly. +``` + + + runtime + + + runtime + + +``` +Note: Ensure the package reference version matches the install version of jellyfin server, otherwise the plugin will show as NotSupported. + ## 2. Set Up the Basics There are a few mandatory classes you'll need for a plugin so we need to make them. ### PluginConfiguration +Create a folder named "Configuration", and a PluginConfiguration.cs file inside. + 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` +It should look something like the following: +```c# + using MediaBrowser.Model.Plugins; + + namespace MyJellyfinPlugin.Configuration; + class PluginConfiguration : BasePluginConfiguration + { + + } +``` + ### 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` +This is the main class for your plugin and will reside in the root of your project. It will define your name, version and Id. It should inherit from `MediaBrowser.Common.Plugins.BasePlugin` + +It should look something like the following: +```c# + using MediaBrowser.Common.Plugins; + using MyJellyfinPlugin.Configuration; + + namespace MyJellyfinPlugin; + + class Plugin : BasePlugin + { + + } +``` Note: If you called your PluginConfiguration class something different, you need to put that between the <> @@ -99,7 +139,7 @@ or ## 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 a subfolder (named after your plugin for example) within 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 a subfolder (named after your plugin for example) within the plugins folder under your Jellyfin directory (Normally C:\Users\{YourUserName}\AppData\Local\jellyfin\plugins). If you want to try and hook it up to a debugger make sure you copy the generated PDB file alongside it. 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.