[
  {
    "path": ".editorconfig",
    "content": "# With more recent updates Visual Studio 2017 supports EditorConfig files out of the box\n# Visual Studio Code needs an extension: https://github.com/editorconfig/editorconfig-vscode\n# For emacs, vim, np++ and other editors, see here: https://github.com/editorconfig\n###############################\n# Core EditorConfig Options   #\n###############################\nroot = true\n# All files\n[*]\nindent_style = space\nindent_size = 4\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\nend_of_line = lf\nmax_line_length = off\n\n# YAML indentation\n[*.{yml,yaml}]\nindent_size = 2\n\n# XML indentation\n[*.{csproj,xml}]\nindent_size = 2\n\n###############################\n# .NET Coding Conventions     #\n###############################\n[*.{cs,vb}]\n# Organize usings\ndotnet_sort_system_directives_first = true\n# this. preferences\ndotnet_style_qualification_for_field = false:silent\ndotnet_style_qualification_for_property = false:silent\ndotnet_style_qualification_for_method = false:silent\ndotnet_style_qualification_for_event = false:silent\n# Language keywords vs BCL types preferences\ndotnet_style_predefined_type_for_locals_parameters_members = true:silent\ndotnet_style_predefined_type_for_member_access = true:silent\n# Parentheses preferences\ndotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent\ndotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent\ndotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent\ndotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent\n# Modifier preferences\ndotnet_style_require_accessibility_modifiers = for_non_interface_members:silent\ndotnet_style_readonly_field = true:suggestion\n# Expression-level preferences\ndotnet_style_object_initializer = true:suggestion\ndotnet_style_collection_initializer = true:suggestion\ndotnet_style_explicit_tuple_names = true:suggestion\ndotnet_style_null_propagation = true:suggestion\ndotnet_style_coalesce_expression = true:suggestion\ndotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent\ndotnet_style_prefer_inferred_tuple_names = true:suggestion\ndotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion\ndotnet_style_prefer_auto_properties = true:silent\ndotnet_style_prefer_conditional_expression_over_assignment = true:silent\ndotnet_style_prefer_conditional_expression_over_return = true:silent\n\n###############################\n# Naming Conventions          #\n###############################\n# Style Definitions (From Roslyn)\n\n# Non-private static fields are PascalCase\ndotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion\ndotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields\ndotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style\n\ndotnet_naming_symbols.non_private_static_fields.applicable_kinds = field\ndotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected\ndotnet_naming_symbols.non_private_static_fields.required_modifiers = static\n\ndotnet_naming_style.non_private_static_field_style.capitalization = pascal_case\n\n# Constants are PascalCase\ndotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion\ndotnet_naming_rule.constants_should_be_pascal_case.symbols = constants\ndotnet_naming_rule.constants_should_be_pascal_case.style = constant_style\n\ndotnet_naming_symbols.constants.applicable_kinds = field, local\ndotnet_naming_symbols.constants.required_modifiers = const\n\ndotnet_naming_style.constant_style.capitalization = pascal_case\n\n# Static fields are camelCase and start with s_\ndotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion\ndotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields\ndotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style\n\ndotnet_naming_symbols.static_fields.applicable_kinds = field\ndotnet_naming_symbols.static_fields.required_modifiers = static\n\ndotnet_naming_style.static_field_style.capitalization = camel_case\ndotnet_naming_style.static_field_style.required_prefix = _\n\n# Instance fields are camelCase and start with _\ndotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion\ndotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields\ndotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style\n\ndotnet_naming_symbols.instance_fields.applicable_kinds = field\n\ndotnet_naming_style.instance_field_style.capitalization = camel_case\ndotnet_naming_style.instance_field_style.required_prefix = _\n\n# Locals and parameters are camelCase\ndotnet_naming_rule.locals_should_be_camel_case.severity = suggestion\ndotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters\ndotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style\n\ndotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local\n\ndotnet_naming_style.camel_case_style.capitalization = camel_case\n\n# Local functions are PascalCase\ndotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion\ndotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions\ndotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style\n\ndotnet_naming_symbols.local_functions.applicable_kinds = local_function\n\ndotnet_naming_style.local_function_style.capitalization = pascal_case\n\n# By default, name items with PascalCase\ndotnet_naming_rule.members_should_be_pascal_case.severity = suggestion\ndotnet_naming_rule.members_should_be_pascal_case.symbols = all_members\ndotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style\n\ndotnet_naming_symbols.all_members.applicable_kinds = *\n\ndotnet_naming_style.pascal_case_style.capitalization = pascal_case\n\n###############################\n# C# Coding Conventions       #\n###############################\n[*.cs]\n# var preferences\ncsharp_style_var_for_built_in_types = true:silent\ncsharp_style_var_when_type_is_apparent = true:silent\ncsharp_style_var_elsewhere = true:silent\n# Expression-bodied members\ncsharp_style_expression_bodied_methods = false:silent\ncsharp_style_expression_bodied_constructors = false:silent\ncsharp_style_expression_bodied_operators = false:silent\ncsharp_style_expression_bodied_properties = true:silent\ncsharp_style_expression_bodied_indexers = true:silent\ncsharp_style_expression_bodied_accessors = true:silent\n# Pattern matching preferences\ncsharp_style_pattern_matching_over_is_with_cast_check = true:suggestion\ncsharp_style_pattern_matching_over_as_with_null_check = true:suggestion\n# Null-checking preferences\ncsharp_style_throw_expression = true:suggestion\ncsharp_style_conditional_delegate_call = true:suggestion\n# Modifier preferences\ncsharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion\n# Expression-level preferences\ncsharp_prefer_braces = true:silent\ncsharp_style_deconstructed_variable_declaration = true:suggestion\ncsharp_prefer_simple_default_expression = true:suggestion\ncsharp_style_pattern_local_over_anonymous_function = true:suggestion\ncsharp_style_inlined_variable_declaration = true:suggestion\n\n###############################\n# C# Formatting Rules         #\n###############################\n# New line preferences\ncsharp_new_line_before_open_brace = all\ncsharp_new_line_before_else = true\ncsharp_new_line_before_catch = true\ncsharp_new_line_before_finally = true\ncsharp_new_line_before_members_in_object_initializers = true\ncsharp_new_line_before_members_in_anonymous_types = true\ncsharp_new_line_between_query_expression_clauses = true\n# Indentation preferences\ncsharp_indent_case_contents = true\ncsharp_indent_switch_labels = true\ncsharp_indent_labels = flush_left\n# Space preferences\ncsharp_space_after_cast = false\ncsharp_space_after_keywords_in_control_flow_statements = true\ncsharp_space_between_method_call_parameter_list_parentheses = false\ncsharp_space_between_method_declaration_parameter_list_parentheses = false\ncsharp_space_between_parentheses = false\ncsharp_space_before_colon_in_inheritance_clause = true\ncsharp_space_after_colon_in_inheritance_clause = true\ncsharp_space_around_binary_operators = before_and_after\ncsharp_space_between_method_declaration_empty_parameter_list_parentheses = false\ncsharp_space_between_method_call_name_and_opening_parenthesis = false\ncsharp_space_between_method_call_empty_parameter_list_parentheses = false\n# Wrapping preferences\ncsharp_preserve_single_line_statements = true\ncsharp_preserve_single_line_blocks = true\n"
  },
  {
    "path": ".github/renovate.json",
    "content": "{\n    \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n    \"extends\": [\n        \"github>jellyfin/.github//renovate-presets/default\"\n    ]\n}"
  },
  {
    "path": ".github/workflows/build.yaml",
    "content": "name: '🏗️ Build Plugin'\n\non:\n  push:\n    branches:\n      - master\n    paths-ignore:\n      - '**/*.md'\n  pull_request:\n    branches:\n      - master\n    paths-ignore:\n      - '**/*.md'\n  workflow_dispatch:\n\njobs:\n  call:\n    uses: jellyfin/jellyfin-meta-plugins/.github/workflows/build.yaml@master\n"
  },
  {
    "path": ".github/workflows/changelog.yaml",
    "content": "name: '📝 Create/Update Release Draft & Release Bump PR'\n\non:\n  push:\n    branches:\n      - master\n    paths-ignore:\n      - build.yaml\n  workflow_dispatch:\n  repository_dispatch:\n    types:\n      - update-prep-command\n\njobs:\n  call:\n    uses: jellyfin/jellyfin-meta-plugins/.github/workflows/changelog.yaml@master\n    with:\n      repository-name: jellyfin/jellyfin-plugin-template\n    secrets:\n      token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/command-dispatch.yaml",
    "content": "# Allows for the definition of PR and Issue /commands\nname: '📟 Slash Command Dispatcher'\n\non:\n  issue_comment:\n    types:\n      - created\n\njobs:\n  call:\n    uses: jellyfin/jellyfin-meta-plugins/.github/workflows/command-dispatch.yaml@master\n    secrets:\n      token: .\n"
  },
  {
    "path": ".github/workflows/command-rebase.yaml",
    "content": "name: '🔀 PR Rebase Command'\n\non:\n  repository_dispatch:\n    types:\n      - rebase-command\n\njobs:\n  call:\n    uses: jellyfin/jellyfin-meta-plugins/.github/workflows/command-rebase.yaml@master\n    with:\n      rebase-head: ${{ github.event.client_payload.pull_request.head.label }}\n      repository-full-name: ${{ github.event.client_payload.github.payload.repository.full_name }}\n      comment-id: ${{ github.event.client_payload.github.payload.comment.id }}\n    secrets:\n      token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/publish.yaml",
    "content": "name: '🚀 Publish Plugin'\n\non:\n  release:\n    types:\n      - released\n  workflow_dispatch:\n\njobs:\n  call:\n    uses: jellyfin/jellyfin-meta-plugins/.github/workflows/publish.yaml@master\n    with:\n      version: ${{ github.event.release.tag_name }}\n      is-unstable: ${{ github.event.release.prerelease }}\n    secrets:\n      deploy-host: ${{ secrets.DEPLOY_HOST }}\n      deploy-user: ${{ secrets.DEPLOY_USER }}\n      deploy-key: ${{ secrets.DEPLOY_KEY }}\n"
  },
  {
    "path": ".github/workflows/scan-codeql.yaml",
    "content": "name: '🔬 Run CodeQL'\n\non:\n  push:\n    branches: [ master ]\n    paths-ignore:\n      - '**/*.md'\n  pull_request:\n    branches: [ master ]\n    paths-ignore:\n      - '**/*.md'\n  schedule:\n    - cron: '24 2 * * 4'\n  workflow_dispatch:\n\njobs:\n  call:\n    uses: jellyfin/jellyfin-meta-plugins/.github/workflows/scan-codeql.yaml@master\n    with:\n      repository-name: jellyfin/jellyfin-plugin-template\n"
  },
  {
    "path": ".github/workflows/sync-labels.yaml",
    "content": "name: '🏷️ Sync labels'\n\non:\n  schedule:\n    - cron: '0 0 1 * *'\n  workflow_dispatch:\n\njobs:\n  call:\n    uses: jellyfin/jellyfin-meta-plugins/.github/workflows/sync-labels.yaml@master\n    secrets:\n      token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/test.yaml",
    "content": "name: '🧪 Test Plugin'\n\non:\n  push:\n    branches:\n      - master\n    paths-ignore:\n      - '**/*.md'\n  pull_request:\n    branches:\n      - master\n    paths-ignore:\n      - '**/*.md'\n  workflow_dispatch:\n\njobs:\n  call:\n    uses: jellyfin/jellyfin-meta-plugins/.github/workflows/test.yaml@master\n"
  },
  {
    "path": ".gitignore",
    "content": "bin/\nobj/\n.vs/\n.idea/\nartifacts\n"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n    // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.\n    // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp\n    // List of extensions which should be recommended for users of this workspace.\n    \"recommendations\": [\n        \"ms-dotnettools.csharp\",\n        \"editorconfig.editorconfig\"\n    ],\n    // List of extensions recommended by VS Code that should not be recommended for users of this workspace.\n    \"unwantedRecommendations\": []\n}"
  },
  {
    "path": ".vscode/launch.json",
    "content": "{\n    // Paths and plugin names are configured in settings.json\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"type\": \"coreclr\",\n            \"name\": \"Launch\",\n            \"request\": \"launch\",\n            \"preLaunchTask\": \"build-and-copy\",\n            \"program\": \"${config:jellyfinDir}/bin/Debug/net9.0/jellyfin.dll\",\n            \"args\": [\n               //\"--nowebclient\"\n               \"--webdir\",\n               \"${config:jellyfinWebDir}/dist/\"\n            ],\n            \"cwd\": \"${config:jellyfinDir}\",\n        }\n    ]\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n    // jellyfinDir : The directory of the cloned jellyfin server project\n    // This needs to be built once before it can be used\n    \"jellyfinDir\": \"${workspaceFolder}/../jellyfin/Jellyfin.Server\",\n    // jellyfinWebDir : The directory of the cloned jellyfin-web project\n    // This needs to be built once before it can be used\n    \"jellyfinWebDir\": \"${workspaceFolder}/../jellyfin-web\",\n    // jellyfinDataDir : the root data directory for a running jellyfin instance\n    // This is where jellyfin stores its configs, plugins, metadata etc\n    // This is platform specific by default, but on Windows defaults to\n    // ${env:LOCALAPPDATA}/jellyfin\n    // and on Linux, it defaults to\n    // ${env:XDG_DATA_HOME}/jellyfin\n    // However ${env:XDG_DATA_HOME} does not work in Visual Studio Code's development container!\n    \"jellyfinWindowsDataDir\": \"${env:LOCALAPPDATA}/jellyfin\",\n    \"jellyfinLinuxDataDir\": \"$HOME/.local/share/jellyfin\",\n    // The name of the plugin\n    \"pluginName\": \"Jellyfin.Plugin.Template\",\n}"
  },
  {
    "path": ".vscode/tasks.json",
    "content": "{\n  // Paths and plugin name are configured in settings.json\n  \"version\": \"2.0.0\",\n  \"tasks\": [\n    {\n      // A chain task - build the plugin, then copy it to your\n      // jellyfin server's plugin directory\n      \"label\": \"build-and-copy\",\n      \"dependsOrder\": \"sequence\",\n      \"dependsOn\": [\n        \"build\",\n        \"make-plugin-dir\",\n        \"copy-dll\"\n      ]\n    },\n    {\n      // Build the plugin\n      \"label\": \"build\",\n      \"command\": \"dotnet\",\n      \"type\": \"shell\",\n      \"args\": [\n        \"publish\",\n        \"--configuration=Debug\",\n        \"${workspaceFolder}/${config:pluginName}.sln\",\n        \"/property:GenerateFullPaths=true\",\n        \"/consoleloggerparameters:NoSummary\"\n      ],\n      \"group\": \"build\",\n      \"presentation\": {\n        \"reveal\": \"silent\"\n      },\n      \"problemMatcher\": \"$msCompile\"\n    },\n    {\n      // Ensure the plugin directory exists before trying to use it\n      \"label\": \"make-plugin-dir\",\n      \"type\": \"shell\",\n      \"command\": \"mkdir\",\n      \"windows\": {\n        \"args\": [\n          \"-Force\",\n          \"-Path\",\n          \"${config:jellyfinWindowsDataDir}/plugins/${config:pluginName}/\"\n        ]\n      },\n      \"linux\": {\n        \"args\": [\n          \"-p\",\n          \"${config:jellyfinLinuxDataDir}/plugins/${config:pluginName}/\"\n        ]\n      }\n    },\n    {\n      // Copy the plugin dll to the jellyfin plugin install path\n      // This command copies every .dll from the build directory to the plugin dir\n      // Usually, you probablly only need ${config:pluginName}.dll\n      // But some plugins may bundle extra requirements\n      \"label\": \"copy-dll\",\n      \"type\": \"shell\",\n      \"command\": \"cp\",\n      \"windows\": {\n        \"args\": [\n          \"./${config:pluginName}/bin/Debug/net9.0/publish/*\",\n          \"${config:jellyfinWindowsDataDir}/plugins/${config:pluginName}/\"\n        ]\n      },\n      \"linux\": {\n        \"args\": [\n          \"-r\",\n          \"./${config:pluginName}/bin/Debug/net9.0/publish/*\",\n          \"${config:jellyfinLinuxDataDir}/plugins/${config:pluginName}/\"\n        ]\n      }\n    },\n  ]\n}\n"
  },
  {
    "path": "Directory.Build.props",
    "content": "<Project>\n    <PropertyGroup>\n        <Version>0.0.0.0</Version>\n        <AssemblyVersion>0.0.0.0</AssemblyVersion>\n        <FileVersion>0.0.0.0</FileVersion>\n    </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "Jellyfin.Plugin.Template/Configuration/PluginConfiguration.cs",
    "content": "using MediaBrowser.Model.Plugins;\n\nnamespace Jellyfin.Plugin.Template.Configuration;\n\n/// <summary>\n/// The configuration options.\n/// </summary>\npublic enum SomeOptions\n{\n    /// <summary>\n    /// Option one.\n    /// </summary>\n    OneOption,\n\n    /// <summary>\n    /// Second option.\n    /// </summary>\n    AnotherOption\n}\n\n/// <summary>\n/// Plugin configuration.\n/// </summary>\npublic class PluginConfiguration : BasePluginConfiguration\n{\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"PluginConfiguration\"/> class.\n    /// </summary>\n    public PluginConfiguration()\n    {\n        // set default options here\n        Options = SomeOptions.AnotherOption;\n        TrueFalseSetting = true;\n        AnInteger = 2;\n        AString = \"string\";\n    }\n\n    /// <summary>\n    /// Gets or sets a value indicating whether some true or false setting is enabled..\n    /// </summary>\n    public bool TrueFalseSetting { get; set; }\n\n    /// <summary>\n    /// Gets or sets an integer setting.\n    /// </summary>\n    public int AnInteger { get; set; }\n\n    /// <summary>\n    /// Gets or sets a string setting.\n    /// </summary>\n    public string AString { get; set; }\n\n    /// <summary>\n    /// Gets or sets an enum option.\n    /// </summary>\n    public SomeOptions Options { get; set; }\n}\n"
  },
  {
    "path": "Jellyfin.Plugin.Template/Configuration/configPage.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>Template</title>\n</head>\n<body>\n    <div id=\"TemplateConfigPage\" data-role=\"page\" class=\"page type-interior pluginConfigurationPage\" data-require=\"emby-input,emby-button,emby-select,emby-checkbox\">\n        <div data-role=\"content\">\n            <div class=\"content-primary\">\n                <form id=\"TemplateConfigForm\">\n                    <div class=\"selectContainer\">\n                        <label class=\"selectLabel\" for=\"Options\">Several Options</label>\n                        <select is=\"emby-select\" id=\"Options\" name=\"Options\" class=\"emby-select-withcolor emby-select\">\n                            <option id=\"optOneOption\" value=\"OneOption\">One Option</option>\n                            <option id=\"optAnotherOption\" value=\"AnotherOption\">Another Option</option>\n                        </select>\n                    </div>\n                    <div class=\"inputContainer\">\n                        <label class=\"inputLabel inputLabelUnfocused\" for=\"AnInteger\">An Integer</label>\n                        <input id=\"AnInteger\" name=\"AnInteger\" type=\"number\" is=\"emby-input\" min=\"0\" />\n                        <div class=\"fieldDescription\">A Description</div>\n                    </div>\n                    <div class=\"checkboxContainer checkboxContainer-withDescription\">\n                        <label class=\"emby-checkbox-label\">\n                            <input id=\"TrueFalseSetting\" name=\"TrueFalseCheckBox\" type=\"checkbox\" is=\"emby-checkbox\" />\n                            <span>A Checkbox</span>\n                        </label>\n                    </div>\n                    <div class=\"inputContainer\">\n                        <label class=\"inputLabel inputLabelUnfocused\" for=\"AString\">A String</label>\n                        <input id=\"AString\" name=\"AString\" type=\"text\" is=\"emby-input\" />\n                        <div class=\"fieldDescription\">Another Description</div>\n                    </div>\n                    <div>\n                        <button is=\"emby-button\" type=\"submit\" class=\"raised button-submit block emby-button\">\n                            <span>Save</span>\n                        </button>\n                    </div>\n                </form>\n            </div>\n        </div>\n        <script type=\"text/javascript\">\n            var TemplateConfig = {\n                pluginUniqueId: 'eb5d7894-8eef-4b36-aa6f-5d124e828ce1'\n            };\n\n            document.querySelector('#TemplateConfigPage')\n                .addEventListener('pageshow', function() {\n                    Dashboard.showLoadingMsg();\n                    ApiClient.getPluginConfiguration(TemplateConfig.pluginUniqueId).then(function (config) {\n                        document.querySelector('#Options').value = config.Options;\n                        document.querySelector('#AnInteger').value = config.AnInteger;\n                        document.querySelector('#TrueFalseSetting').checked = config.TrueFalseSetting;\n                        document.querySelector('#AString').value = config.AString;\n                        Dashboard.hideLoadingMsg();\n                    });\n                });\n\n            document.querySelector('#TemplateConfigForm')\n                .addEventListener('submit', function(e) {\n                Dashboard.showLoadingMsg();\n                ApiClient.getPluginConfiguration(TemplateConfig.pluginUniqueId).then(function (config) {\n                    config.Options = document.querySelector('#Options').value;\n                    config.AnInteger = document.querySelector('#AnInteger').value;\n                    config.TrueFalseSetting = document.querySelector('#TrueFalseSetting').checked;\n                    config.AString = document.querySelector('#AString').value;\n                    ApiClient.updatePluginConfiguration(TemplateConfig.pluginUniqueId, config).then(function (result) {\n                        Dashboard.processPluginConfigurationUpdateResult(result);\n                    });\n                });\n\n                e.preventDefault();\n                return false;\n            });\n        </script>\n    </div>\n</body>\n</html>\n"
  },
  {
    "path": "Jellyfin.Plugin.Template/Jellyfin.Plugin.Template.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net9.0</TargetFramework>\n    <RootNamespace>Jellyfin.Plugin.Template</RootNamespace>\n    <GenerateDocumentationFile>true</GenerateDocumentationFile>\n    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>\n    <Nullable>enable</Nullable>\n    <AnalysisMode>AllEnabledByDefault</AnalysisMode>\n    <CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Jellyfin.Controller\" Version=\"10.9.11\" >\n      <ExcludeAssets>runtime</ExcludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Jellyfin.Model\" Version=\"10.9.11\">\n      <ExcludeAssets>runtime</ExcludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"SerilogAnalyzer\" Version=\"0.15.0\" PrivateAssets=\"All\" />\n    <PackageReference Include=\"StyleCop.Analyzers\" Version=\"1.2.0-beta.556\" PrivateAssets=\"All\" />\n    <PackageReference Include=\"SmartAnalyzers.MultithreadingAnalyzer\" Version=\"1.1.31\" PrivateAssets=\"All\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <None Remove=\"Configuration\\configPage.html\" />\n    <EmbeddedResource Include=\"Configuration\\configPage.html\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "Jellyfin.Plugin.Template/Plugin.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Jellyfin.Plugin.Template.Configuration;\nusing MediaBrowser.Common.Configuration;\nusing MediaBrowser.Common.Plugins;\nusing MediaBrowser.Model.Plugins;\nusing MediaBrowser.Model.Serialization;\n\nnamespace Jellyfin.Plugin.Template;\n\n/// <summary>\n/// The main plugin.\n/// </summary>\npublic class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages\n{\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"Plugin\"/> class.\n    /// </summary>\n    /// <param name=\"applicationPaths\">Instance of the <see cref=\"IApplicationPaths\"/> interface.</param>\n    /// <param name=\"xmlSerializer\">Instance of the <see cref=\"IXmlSerializer\"/> interface.</param>\n    public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)\n        : base(applicationPaths, xmlSerializer)\n    {\n        Instance = this;\n    }\n\n    /// <inheritdoc />\n    public override string Name => \"Template\";\n\n    /// <inheritdoc />\n    public override Guid Id => Guid.Parse(\"eb5d7894-8eef-4b36-aa6f-5d124e828ce1\");\n\n    /// <summary>\n    /// Gets the current plugin instance.\n    /// </summary>\n    public static Plugin? Instance { get; private set; }\n\n    /// <inheritdoc />\n    public IEnumerable<PluginPageInfo> GetPages()\n    {\n        return\n        [\n            new PluginPageInfo\n            {\n                Name = Name,\n                EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, \"{0}.Configuration.configPage.html\", GetType().Namespace)\n            }\n        ];\n    }\n}\n"
  },
  {
    "path": "Jellyfin.Plugin.Template.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\n#\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Jellyfin.Plugin.Template\", \"Jellyfin.Plugin.Template\\Jellyfin.Plugin.Template.csproj\", \"{D921B930-CF91-406F-ACBC-08914DCD0D34}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n        {D921B930-CF91-406F-ACBC-08914DCD0D34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Release|x64.Build.0 = Release|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{D921B930-CF91-406F-ACBC-08914DCD0D34}.Release|x86.Build.0 = Release|Any CPU\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "# So you want to make a Jellyfin plugin\n\nAwesome! 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 net8.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.\n\n## 0. Things you need to get started\n\n- [Dotnet SDK 9.0](https://dotnet.microsoft.com/en-us/download/dotnet)\n\n- An editor of your choice. Some free choices are:\n\n   [Visual Studio Code](https://code.visualstudio.com)\n\n   [Visual Studio Community Edition](https://visualstudio.microsoft.com/downloads)\n\n   [Mono Develop](https://www.monodevelop.com)\n\n## 0.5. Quickstarts\n\nWe have a number of quickstart options available to speed you along the way.\n\n- [Download the Example Plugin Project](https://github.com/jellyfin/jellyfin-plugin-template/tree/master/Jellyfin.Plugin.Template) from this repository, open it in your IDE and go to [step 3](https://github.com/jellyfin/jellyfin-plugin-template#3-customize-plugin-information)\n\n- Install our dotnet template by [downloading the dotnet-template/content folder from this repo](https://github.com/jellyfin/jellyfin-plugin-template/tree/master/dotnet-template/content) or off of Nuget (Coming soon)\n\n   ```\n   dotnet new -i /path/to/templatefolder\n   ```\n\n- Run this command then skip to step 4\n\n   ```\n      dotnet new Jellyfin-plugin -name MyPlugin\n   ```\n\nIf 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.\n\n## 1. Initialize Your Project\n\nMake a new dotnet standard project with the following command, it will make a directory for itself.\n\n```\ndotnet new classlib -f net9.0 -n MyJellyfinPlugin\n```\n\nNow add the Jellyfin shared libraries.\n\n```\ndotnet add package Jellyfin.Model\ndotnet add package Jellyfin.Controller\n```\n\nYou have an autogenerated Class1.cs file. You won't be needing this, so go ahead and delete it.\n\nNavigate 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.\nSkipping this step will prevent your plugin from registering correctly.\n```\n<ItemGroup>\n    <PackageReference Include=\"Jellyfin.Controller\" Version=\"10.11.3\">\n        <ExcludeAssets>runtime</ExcludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Jellyfin.Model\" Version=\"10.11.3\">\n        <ExcludeAssets>runtime</ExcludeAssets>\n    </PackageReference>\n</ItemGroup>\n```\nNote: Ensure the package reference version matches the install version of jellyfin server, otherwise the plugin will show as NotSupported.\n\n## 2. Set Up the Basics\n\nThere are a few mandatory classes you'll need for a plugin so we need to make them.\n\n### PluginConfiguration\n\nCreate a folder named \"Configuration\", and a PluginConfiguration.cs file inside.\n\nYou 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`\n\nIt should look something like the following:\n```c#\n    using MediaBrowser.Model.Plugins;\n    \n    namespace MyJellyfinPlugin.Configuration;\n    class PluginConfiguration : BasePluginConfiguration\n    {\n        \n    }\n```\n\n### Plugin\n\nThis 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<PluginConfiguration>`\n\nIt should look something like the following:\n```c#\n    using MediaBrowser.Common.Plugins;\n    using MyJellyfinPlugin.Configuration;\n    \n    namespace MyJellyfinPlugin;\n    \n    class Plugin : BasePlugin<PluginConfiguration>\n    {\n        \n    }\n```\n\nNote: If you called your PluginConfiguration class something different, you need to put that between the <>\n\n### Implement Required Properties\n\nThe Plugin class needs a few properties implemented before it can work correctly.\n\nIt 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.\n\n```c#\npublic Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) : base(applicationPaths, xmlSerializer){}\npublic override string Name => throw new System.NotImplementedException();\npublic override Guid Id => Guid.Parse(\"\");\n```\n\n## 3. Customize Plugin Information\n\nYou 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\n\n- **Windows Users**: you can use the Powershell command `New-Guid`, `[guid]::NewGuid()` or the Visual Studio GUID generator\n\n- **Linux and OS X Users**: you can use the Powershell Core command `New-Guid` or this command from your shell of choice:\n\n   ```bash\n   od -x /dev/urandom | head -n1 | awk '{OFS=\"-\"; srand($6); sub(/./,\"4\",$5); sub(/./,substr(\"89ab\",1+rand()*4,1),$6); print $2$3,$4,$5,$6,$7$8$9}'\n   ```\n\nor\n\n   ```bash\n   uuidgen\n   ```\n\n- Place that guid inside the `Guid.Parse(\"\")` quotes to define your plugin's ID.\n\n## 4. Adding Functionality\n\nCongratulations, 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.\n\nMost 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.\n\n### 4a. Implement Interfaces\n\nIf 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.\n\nHere's some interfaces you could implement for common use cases:\n\n- **IAuthenticationProvider** - Allows you to add an authentication provider that can authenticate a user based on a name and a password, but that doesn't expect to deal with local users.\n- **IBaseItemComparer** - Allows you to add sorting rules for dealing with media that will show up in sort menus\n- **IIntroProvider** - Allows you to play a piece of media before another piece of media (i.e. a trailer before a movie, or a network bumper before an episode of a show)\n- **IItemResolver** - Allows you to define custom media types\n- **ILibraryPostScanTask** - Allows you to define a task that fires after scanning a library\n- **IMetadataSaver** - Allows you to define a metadata standard that Jellyfin can use to write metadata\n- **IResolverIgnoreRule** - Allows you to define subpaths that are ignored by media resolvers for use with another function (i.e. you wanted to have a theme song for each tv series stored in a subfolder that could be accessed by your plugin for playback in a menu).\n- **IScheduledTask** - Allows you to create a scheduled task that will appear in the scheduled task lists on the dashboard.\n\nThere are loads of other interfaces that can be used, but you'll need to poke around the API to get some info. If you're an expert on a particular interface, you should help [contribute some documentation](https://docs.jellyfin.org/general/contributing/index.html)!\n\n### 4b. Use plugin aimed interfaces to add custom functionality\n\nIf your plugin doesn't fit perfectly neatly into a predefined interface, never fear, there are a set of interfaces and classes that allow your plugin to extend Jellyfin any which way you please. Here's a quick overview on how to use them\n\n- **IPluginConfigurationPage** - Allows you to have a plugin config page on the dashboard. If you used one of the quickstart example projects, a premade page with some useful components to work with has been created for you! If not you can check out this guide here for how to whip one up.\n\n **IPluginServiceRegistrator** - Will be located by Jellyfin at server startup and allows you to add services to the DI container to allow for injection in your plugin's classes later.\n\n- **IHostedService** - Allows you to run code as a background task that will be started at program startup and will remain in memory. See [Microsoft's documentation](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-8.0&tabs=visual-studio#ihostedservice-interface) for more information. You can make as many of these as you need; make Jellyfin aware of them with an `IPluginServiceRegistrator`. It is wildly useful for loading configs or persisting state. **Be aware that your main plugin class (IBasePlugin) cannot also be a IHostedService.**\n\n- **ControllerBase** - Allows you to define custom REST-API endpoints. This is the default ASP.NET Web-API controller. You can use it exactly as you would in a normal Web-API project. Learn more about it [here](https://docs.microsoft.com/aspnet/core/web-api/?view=aspnetcore-5.0).\n\nLikewise you might need to get data and services from the Jellyfin core, Jellyfin provides a number of interfaces you can add as parameters to your plugin constructor which are then made available in your project (you can see the 2 mandatory ones that are needed by the plugin system in the constructor as is).\n\n- **IBlurayExaminer** - Allows you to examine blu-ray folders\n- **IDtoService** - Allows you to create data transport objects, presumably to send to other plugins or to the core\n- **ILibraryManager** - Allows you to directly access the media libraries without hopping through the API\n- **ILocalizationManager** - Allows you tap into the main localization engine which governs translations, rating systems, units etc...\n- **INetworkManager** - Allows you to get information about the server's networking status\n- **IServerApplicationPaths** - Allows you to get the running server's paths\n- **IServerConfigurationManager** - Allows you to write or read server configuration data into the application paths\n- **ITaskManager** - Allows you to execute and manipulate scheduled tasks\n- **IUserManager** - Allows you to retrieve user info and user library related info\n- **IXmlSerializer** - Allows you to use the main xml serializer\n- **IZipClient** - Allows you to use the core zip client for compressing and decompressing data\n\n## 5. Create a Repository\n\n- [See blog post](https://jellyfin.org/posts/plugin-updates/)\n\n## 6. Set Up Debugging\n\nDebugging can be set up by creating tasks which will be executed when running the plugin project. The specifics on setting up these tasks are not included as they may differ from IDE to IDE. The following list describes the general process:\n\n- Compile the plugin in debug mode.\n- Create the plugin directory if it doesn't exist.\n- Copy the plugin into your server's plugin directory. The server will then execute it.\n- Make sure to set the working directory of the program being debugged to the working directory of the Jellyfin Server.\n- Start the server.\n\nSome IDEs like Visual Studio Code may need the following compile flags to compile the plugin:\n\n```shell\ndotnet build Your-Plugin.sln /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary\n```\n\nThese flags generate the full paths for file names and **do not** generate a summary during the build process as this may lead to duplicate errors in the problem panel of your IDE.\n\n### 6.a Set Up Debugging on Visual Studio\n\nVisual Studio allows developers to connect to other processes and debug them, setting breakpoints and inspecting the variables of the program. We can set this up following this steps:\nOn this section we will explain how to set up our solution to enable debugging before the server starts.\n\n1. Right-click on the solution, And click on Add -> Existing Project...\n2. Locate Jellyfin executable in your installation folder and click on 'Open'. It is called `Jellyfin.exe`. Now The solution will have a new \"Project\" called Jellyfin. This is the executable, not the source code of Jellyfin.\n3. Right-click on this new project and click on 'Set up as Startup Project'\n4. Right-click on this new project and click on 'Properties'\n5. Make sure that the 'Attach' parameter is set to 'No'\n\nFrom now on, everytime you click on start from Visual Studio, it will start Jellyfin attached to the debugger!\n\nThe only thing left to do is to compile the project as it is specified a few lines above and you are done.\n\n### 6.b Automate the Setup on Visual Studio Code\n\nVisual Studio Code allows developers to automate the process of starting all necessary dependencies to start debugging the plugin. This guide assumes the reader is familiar with the [documentation on debugging in Visual Studio Code](https://code.visualstudio.com/docs/editor/debugging) and has read the documentation in this file. It is assumed that the Jellyfin Server has already been compiled once. However, should one desire to automatically compile the server before the start of the debugging session, this can be easily implemented, but is not further discussed here.\n\nA full example, which aims to be portable may be found in this repo's `.vscode` folder.\n\nThis example expects you to clone `jellyfin`, `jellyfin-web` and `jellyfin-plugin-template` under the same parent directory, though you can customize this in `settings.json`\n\n1. Create a `settings.json` file inside your `.vscode` folder, to specify common options specific to your local setup.\n   ```jsonc\n    {\n        // jellyfinDir : The directory of the cloned jellyfin server project\n        // This needs to be built once before it can be used\n        \"jellyfinDir\"     : \"${workspaceFolder}/../jellyfin/Jellyfin.Server\",\n        // jellyfinWebDir : The directory of the cloned jellyfin-web project\n        // This needs to be built once before it can be used\n        \"jellyfinWebDir\"  : \"${workspaceFolder}/../jellyfin-web\",\n        // jellyfinDataDir : the root data directory for a running jellyfin instance\n        // This is where jellyfin stores its configs, plugins, metadata etc\n        // This is platform specific by default, but on Windows defaults to\n        // ${env:LOCALAPPDATA}/jellyfin\n        \"jellyfinDataDir\" : \"${env:LOCALAPPDATA}/jellyfin\",\n        // The name of the plugin\n        \"pluginName\" : \"Jellyfin.Plugin.Template\",\n    }\n   ```\n\n1. To automate the launch process, create a new `launch.json` file for C# projects inside the `.vscode` folder. The example below shows only the relevant parts of the file. Adjustments to your specific setup and operating system may be required.\n\n   ```jsonc\n    {\n        // Paths and plugin names are configured in settings.json\n        \"version\": \"0.2.0\",\n        \"configurations\": [\n            {\n                \"type\": \"coreclr\",\n                \"name\": \"Launch\",\n                \"request\": \"launch\",\n                \"preLaunchTask\": \"build-and-copy\",\n                \"program\": \"${config:jellyfinDir}/bin/Debug/net8.0/jellyfin.dll\",\n                \"args\": [\n                //\"--nowebclient\"\n                \"--webdir\",\n                \"${config:jellyfinWebDir}/dist/\"\n                ],\n                \"cwd\": \"${config:jellyfinDir}\",\n            }\n        ]\n    }\n\n   ```\n\n   The `request` type is specified as `launch`, as this `launch.json` file will start the Jellyfin Server process. The `preLaunchTask` defines a task that will run before the Jellyfin Server starts. More on this later. It is important to set the `program` path to the Jellyin Server program and set the current working directory (`cwd`) to the working directory of the Jellyfin Server.\n   The `args` option allows to specify arguments to be passed to the server, e.g. whether Jellyfin should start with the web-client or without it.\n\n2. Create a `tasks.json` file inside your `.vscode` folder and specify a `build-and-copy` task that will run in `sequence` order. This tasks depends on multiple other tasks and all of those other tasks can be defined as simple `shell` tasks that run commands like the `cp` command to copy a file. The sequence to run those tasks in is given below. Please note that it might be necessary to adjust the examples for your specific setup and operating system.\n\n   The full file is shown here - Specific sections will be discussed in depth\n    ```jsonc\n    {\n        // Paths and plugin name are configured in settings.json\n        \"version\": \"2.0.0\",\n        \"tasks\": [\n            {\n            // A chain task - build the plugin, then copy it to your\n            // jellyfin server's plugin directory\n            \"label\": \"build-and-copy\",\n            \"dependsOrder\": \"sequence\",\n            \"dependsOn\": [\"build\", \"make-plugin-dir\", \"copy-dll\"]\n            },\n            {\n            // Build the plugin\n            \"label\": \"build\",\n            \"command\": \"dotnet\",\n            \"type\": \"shell\",\n            \"args\": [\n                \"publish\",\n                \"${workspaceFolder}/${config:pluginName}.sln\",\n                \"/property:GenerateFullPaths=true\",\n                \"/consoleloggerparameters:NoSummary\"\n            ],\n            \"group\": \"build\",\n            \"presentation\": {\n                \"reveal\": \"silent\"\n            },\n            \"problemMatcher\": \"$msCompile\"\n            },\n            {\n                // Ensure the plugin directory exists before trying to use it\n                \"label\": \"make-plugin-dir\",\n                \"type\": \"shell\",\n                \"command\": \"mkdir\",\n                \"args\": [\n                \"-Force\",\n                \"-Path\",\n                \"${config:jellyfinDataDir}/plugins/${config:pluginName}/\"\n                ]\n            },\n            {\n                // Copy the plugin dll to the jellyfin plugin install path\n                // This command copies every .dll from the build directory to the plugin dir\n                // Usually, you probablly only need ${config:pluginName}.dll\n                // But some plugins may bundle extra requirements\n                \"label\": \"copy-dll\",\n                \"type\": \"shell\",\n                \"command\": \"cp\",\n                \"args\": [\n                \"./${config:pluginName}/bin/Debug/net8.0/publish/*\",\n                \"${config:jellyfinDataDir}/plugins/${config:pluginName}/\"\n                ]\n\n            },\n        ]\n    }\n\n    ```\n    1.  The \"build-and-copy\" task which triggers all of the other tasks\n    ```jsonc\n        {\n        // A chain task - build the plugin, then copy it to your\n        // jellyfin server's plugin directory\n        \"label\": \"build-and-copy\",\n        \"dependsOrder\": \"sequence\",\n        \"dependsOn\": [\"build\", \"make-plugin-dir\", \"copy-dll\"]\n        },\n    ```\n    2.  A build task. This task builds the plugin without generating summary, but with full paths for file names enabled.\n\n        ```jsonc\n            {\n            // Build the plugin\n            \"label\": \"build\",\n            \"command\": \"dotnet\",\n            \"type\": \"shell\",\n            \"args\": [\n                \"publish\",\n                \"${workspaceFolder}/${config:pluginName}.sln\",\n                \"/property:GenerateFullPaths=true\",\n                \"/consoleloggerparameters:NoSummary\"\n            ],\n            \"group\": \"build\",\n            \"presentation\": {\n                \"reveal\": \"silent\"\n            },\n            \"problemMatcher\": \"$msCompile\"\n            },\n        ```\n\n    3.  A tasks which creates the necessary plugin directory and a sub-folder for the specific plugin. The plugin directory is located below the [data directory](https://jellyfin.org/docs/general/administration/configuration.html) of the Jellyfin Server. As an example, the following path can be used for the bookshelf plugin: `$HOME/.local/share/jellyfin/plugins/Bookshelf/`\n        ```jsonc\n            {\n                // Ensure the plugin directory exists before trying to use it\n                \"label\": \"make-plugin-dir\",\n                \"type\": \"shell\",\n                \"command\": \"mkdir\",\n                \"args\": [\n                \"-Force\",\n                \"-Path\",\n                \"${config:jellyfinDataDir}/plugins/${config:pluginName}/\"\n                ]\n            },\n        ```\n\n    4.  A tasks which copies the plugin dll which has been built in step 2.1. The file is copied into it's specific plugin directory within the server's plugin directory.\n\n        ```jsonc\n            {\n                // Copy the plugin dll to the jellyfin plugin install path\n                // This command copies every .dll from the build directory to the plugin dir\n                // Usually, you probablly only need ${config:pluginName}.dll\n                // But some plugins may bundle extra requirements\n                \"label\": \"copy-dll\",\n                \"type\": \"shell\",\n                \"command\": \"cp\",\n                \"args\": [\n                \"./${config:pluginName}/bin/Debug/net8.0/publish/*\",\n                \"${config:jellyfinDataDir}/plugins/${config:pluginName}/\"\n                ]\n            },\n        ```\n\n## Licensing\n\nLicensing 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.\n\nDue to how plugins in Jellyfin work, when your plugin is compiled into a binary, it will link against the various Jellyfin binary NuGet packages. These packages are licensed under the GPLv3. Thus, due to the nature and restrictions of the GPL, the binary plugin you get will also be licensed under the GPLv3.\n\nIf you accept the default GPLv3 license from this template, all will be good. However if you choose a different license, please keep this fact in mind, as it might not always be obvious that an, e.g. MIT-licensed plugin would become GPLv3 when compiled.\n\nPlease note that this also means making \"proprietary\", source-unavailable, or otherwise \"hidden\" plugins for public consumption is not permitted. To build a Jellyfin plugin for distribution to others, it must be under the GPLv3 or a permissive open-source license that can be linked against the GPLv3.\n"
  },
  {
    "path": "build.yaml",
    "content": "---\nname: \"Template\"\nguid: \"eb5d7894-8eef-4b36-aa6f-5d124e828ce1\"\nversion: \"1.0.0.0\"\ntargetAbi: \"10.9.0.0\"\nframework: \"net8.0\"\noverview: \"Short description about your plugin\"\ndescription: >\n  This is a longer description that can span more than one\n  line and include details about your plugin.\ncategory: \"General\"\nowner: \"jellyfin\"\nartifacts:\n- \"Jellyfin.Plugin.Template.dll\"\nchangelog: >\n  changelog\n"
  },
  {
    "path": "jellyfin.ruleset",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RuleSet Name=\"Rules for Jellyfin.Server\" Description=\"Code analysis rules for Jellyfin.Server.csproj\" ToolsVersion=\"14.0\">\n    <Rules AnalyzerId=\"StyleCop.Analyzers\" RuleNamespace=\"StyleCop.Analyzers\">\n        <!-- disable warning SA1009: Closing parenthesis should be followed by a space. -->\n        <Rule Id=\"SA1009\" Action=\"None\" />\n        <!-- disable warning SA1011: Closing square bracket should be followed by a space. -->\n        <Rule Id=\"SA1011\" Action=\"None\" />\n        <!-- disable warning SA1101: Prefix local calls with 'this.' -->\n        <Rule Id=\"SA1101\" Action=\"None\" />\n        <!-- disable warning SA1108: Block statements should not contain embedded comments -->\n        <Rule Id=\"SA1108\" Action=\"None\" />\n        <!-- disable warning SA1118: Parameter must not span multiple lines. -->\n        <Rule Id=\"SA1118\" Action=\"None\" />\n        <!-- disable warning SA1128:: Put constructor initializers on their own line -->\n        <Rule Id=\"SA1128\" Action=\"None\" />\n        <!-- disable warning SA1130: Use lambda syntax -->\n        <Rule Id=\"SA1130\" Action=\"None\" />\n        <!-- disable warning SA1200: 'using' directive must appear within a namespace declaration -->\n        <Rule Id=\"SA1200\" Action=\"None\" />\n        <!-- disable warning SA1202: 'public' members must come before 'private' members -->\n        <Rule Id=\"SA1202\" Action=\"None\" />\n        <!-- disable warning SA1204: Static members must appear before non-static members -->\n        <Rule Id=\"SA1204\" Action=\"None\" />\n        <!-- disable warning SA1309: Fields must not begin with an underscore -->\n        <Rule Id=\"SA1309\" Action=\"None\" />\n        <!-- disable warning SA1413: Use trailing comma in multi-line initializers -->\n        <Rule Id=\"SA1413\" Action=\"None\" />\n        <!-- disable warning SA1512: Single-line comments must not be followed by blank line -->\n        <Rule Id=\"SA1512\" Action=\"None\" />\n        <!-- disable warning SA1515: Single-line comment should be preceded by blank line -->\n        <Rule Id=\"SA1515\" Action=\"None\" />\n        <!-- disable warning SA1600: Elements should be documented -->\n        <Rule Id=\"SA1600\" Action=\"None\" />\n        <!-- disable warning SA1602: Enumeration items should be documented -->\n        <Rule Id=\"SA1602\" Action=\"None\" />\n        <!-- disable warning SA1633: The file header is missing or not located at the top of the file -->\n        <Rule Id=\"SA1633\" Action=\"None\" />\n    </Rules>\n\n    <Rules AnalyzerId=\"Microsoft.CodeAnalysis.NetAnalyzers\" RuleNamespace=\"Microsoft.Design\">\n        <!-- error on CA1305: Specify IFormatProvider -->\n        <Rule Id=\"CA1305\" Action=\"Error\" />\n        <!-- error on CA1725: Parameter names should match base declaration -->\n        <Rule Id=\"CA1725\" Action=\"Error\" />\n        <!-- error on CA1725: Call async methods when in an async method -->\n        <Rule Id=\"CA1727\" Action=\"Error\" />\n        <!-- error on CA1843: Do not use 'WaitAll' with a single task -->\n        <Rule Id=\"CA1843\" Action=\"Error\" />\n        <!-- error on CA2016: Forward the CancellationToken parameter to methods that take one\n            or pass in 'CancellationToken.None' explicitly to indicate intentionally not propagating the token -->\n        <Rule Id=\"CA2016\" Action=\"Error\" />\n        <!-- error on CA2254: Template should be a static expression -->\n        <Rule Id=\"CA2254\" Action=\"Error\" />\n\n        <!-- disable warning CA1014: Mark assemblies with CLSCompliantAttribute -->\n        <Rule Id=\"CA1014\" Action=\"Info\" />\n        <!-- disable warning CA1024: Use properties where appropriate -->\n        <Rule Id=\"CA1024\" Action=\"Info\" />\n        <!-- disable warning CA1031: Do not catch general exception types -->\n        <Rule Id=\"CA1031\" Action=\"Info\" />\n        <!-- disable warning CA1032: Implement standard exception constructors -->\n        <Rule Id=\"CA1032\" Action=\"Info\" />\n        <!-- disable warning CA1040: Avoid empty interfaces -->\n        <Rule Id=\"CA1040\" Action=\"Info\" />\n        <!-- disable warning CA1062: Validate arguments of public methods -->\n        <Rule Id=\"CA1062\" Action=\"Info\" />\n        <!-- TODO: enable when false positives are fixed -->\n        <!-- disable warning CA1508: Avoid dead conditional code -->\n        <Rule Id=\"CA1508\" Action=\"Info\" />\n        <!-- disable warning CA1716: Identifiers should not match keywords -->\n        <Rule Id=\"CA1716\" Action=\"Info\" />\n        <!-- disable warning CA1720: Identifiers should not contain type names -->\n        <Rule Id=\"CA1720\" Action=\"Info\" />\n        <!-- disable warning CA1724: Type names should not match namespaces -->\n        <Rule Id=\"CA1724\" Action=\"Info\" />\n        <!-- disable warning CA1805: Do not initialize unnecessarily -->\n        <Rule Id=\"CA1805\" Action=\"Info\" />\n        <!-- disable warning CA1812: internal class that is apparently never instantiated.\n            If so, remove the code from the assembly.\n            If this class is intended to contain only static members, make it static -->\n        <Rule Id=\"CA1812\" Action=\"Info\" />\n        <!-- disable warning CA1822: Member does not access instance data and can be marked as static -->\n        <Rule Id=\"CA1822\" Action=\"Info\" />\n        <!-- disable warning CA2000: Dispose objects before losing scope -->\n        <Rule Id=\"CA2000\" Action=\"Info\" />\n        <!-- disable warning CA2253: Named placeholders should not be numeric values -->\n        <Rule Id=\"CA2253\" Action=\"Info\" />\n        <!-- disable warning CA5394: Do not use insecure randomness -->\n        <Rule Id=\"CA5394\" Action=\"Info\" />\n\n        <!-- disable warning CA1054: Change the type of parameter url from string to System.Uri -->\n        <Rule Id=\"CA1054\" Action=\"None\" />\n        <!-- disable warning CA1055: URI return values should not be strings -->\n        <Rule Id=\"CA1055\" Action=\"None\" />\n        <!-- disable warning CA1056: URI properties should not be strings -->\n        <Rule Id=\"CA1056\" Action=\"None\" />\n        <!-- disable warning CA1303: Do not pass literals as localized parameters -->\n        <Rule Id=\"CA1303\" Action=\"None\" />\n        <!-- disable warning CA1308: Normalize strings to uppercase -->\n        <Rule Id=\"CA1308\" Action=\"None\" />\n        <!-- disable warning CA1848: Use the LoggerMessage delegates -->\n        <Rule Id=\"CA1848\" Action=\"None\" />\n        <!-- disable warning CA2101: Specify marshaling for P/Invoke string arguments -->\n        <Rule Id=\"CA2101\" Action=\"None\" />\n        <!-- disable warning CA2234: Pass System.Uri objects instead of strings -->\n        <Rule Id=\"CA2234\" Action=\"None\" />\n    </Rules>\n</RuleSet>\n"
  }
]