Development Guide

Build

Contributing

We welcome contributions! Here’s how to get started:

  1. Fork the repository.
  2. In the scripts directory, use build-branch.ps1 and build-release.ps1 to easily test changes. Be sure to set the GitHubUsername and any required parameters.
  3. Iteratively develop code. Jellyfin and C# can be a bit unforgiving.
  4. Test thoroughly on 10.11.* and 10.10.7 docker instances.
  5. Submit a pull request.

Planned Features

  1. Add a modal dialog when the network options are double-clicked from the active or available network multiselect. Options include β€œAdd to Selected Networks” (if in available) or β€œRemove from Selected Networks” (if active).
  2. Faster refreshes that target only the metadata items that have been changed.
  3. Change the smart sort to include cast and directors as criteria, and watched media.
  4. Fetch additional content from Jellyseerr before the built-in Jellyfin metadata refresh.

Completed Features

  1. Extract the request favorites function from the sync task. The favorites function can be triggered directly from the Favorite event handler in Jellyfin. See Issue #12.
  2. Support for Jellyfin 10.11.*! See Issue #1.
  3. Change sort order based on user preference or implement a random sort order plugin.
  4. Allow users to upload a custom image for promo videos.
  5. Adding new feature from Issue #37 β€œMixed Movies and Shows” to allow users to switch from a single library to separate Movies and Shows libraries.

Dependencies

This plugin uses:

  • .NET 8.0 - Target framework for Jellyfin 10.10.7
  • .NET 9.0 - Target framework for Jellyfin 10.11.0
  • .NET 10.0 - Target framework for Jellyfin 12.0
  • Jellyfin NuGet - Plugin SDK packages (version-specific)
  • ASP.NET Core - For API endpoints
  • Microsoft.Extensions (8.0.1 for net8.0, 9.0.10 for net9.0, 10.0.11 for net10.0) - For dependency injection and logging
  • Newtonsoft.Json - For JSON serialization
  • PowerShell 7 or greater - For build scripts
  • VS Code - IDE, Visual Studio probably also works

The project automatically selects the correct target framework and package versions based on the JellyfinVersion build property.

Building the Plugin

Recommended to use the /scripts/build-branch.ps1 PowerShell script.

  1. Clone the repository
    git clone https://github.com/kinggeorges12/JellyBridge.git
    cd JellyBridge
    
  2. Restore dependencies
    dotnet restore src\Jellyfin.Plugin.JellyBridge\JellyBridge.csproj
    
  3. Build the plugin

    For Jellyfin 10.10.7 (net8.0):

    dotnet build src\Jellyfin.Plugin.JellyBridge\JellyBridge.csproj --configuration Release --warnaserror -p:JellyfinVersion=10.10.7
    

    For Jellyfin 10.11.0 (net9.0):

    dotnet build src\Jellyfin.Plugin.JellyBridge\JellyBridge.csproj --configuration Release --warnaserror -p:JellyfinVersion=10.11.0
    

    For Jellyfin 10.11.0 (net9.0):

    dotnet build src\Jellyfin.Plugin.JellyBridge\JellyBridge.csproj --configuration Release --warnaserror -p:JellyfinVersion=12.0
    
  4. Publish a new release

    Add the metadata.json to the release. Zip the .dll and metadata and place in the release directory.

       $metaJson = @{
          guid = $pluginInfo.guid
          name = $pluginInfo.name
          description = $pluginInfo.description
          owner = $pluginInfo.owner
          category = $pluginInfo.category
          version = $ver_sub
          changelog = $ChangelogText
          targetAbi = $minAbi
          timestamp = $timestamp
          status = "Active"
          autoUpdate = $true
          assemblies = @("JellyBridge.dll")
       }
       Compress-Archive -Path $dllPath, $metaPath -DestinationPath $zipPath -Force
    
  5. Update the manifest

    Add an entry in manifest.json for your new release, pointing to the zip file in the release directory.

       $entry = @{
          version = $ver_sub
          changelog = "Jellyfin $($t.JellyfinVersion): $ChangelogText"
          targetAbi = $minAbi
          sourceUrl = "https://raw.githubusercontent.com/$GitHubUsername/JellyBridge/$Branch/release/$zipName"
          checksum = $checksum
          timestamp = $timestamp
          dependencies = @()
       }
    

Manual Installation

Recommended to publish releases through the manifest and update plugins through the Jellyfin UI. I have not had any luck using local releases, although you may find online resources with better instructions.

After building, copy the DLL to your Jellyfin plugins folder:

  1. Navigate to the build output directory based on your Jellyfin version:
    • Jellyfin 10.10.7: src\Jellyfin.Plugin.JellyBridge\bin\Release\net8.0\
    • Jellyfin 10.11.0: src\Jellyfin.Plugin.JellyBridge\bin\Release\net9.0\
    • Jellyfin 12.0: src\Jellyfin.Plugin.JellyBridge\bin\Release\net10.0\
  2. Copy the JellyBridge.dll file
  3. Place it in your Jellyfin plugins directory:
    • Linux: /var/lib/jellyfin/plugins/
    • Windows: C:\ProgramData\Jellyfin\plugins\
    • Docker: volume mount to your plugins directory
  4. Restart Jellyfin

Scripts

The project includes several useful PowerShell scripts in the scripts directory:

check-models.ps1 - Model Validation Script

Purpose: Validates all generated C# files for missing classes, enums, and conversion issues.

Usage:

pwsh -File scripts/check-models.ps1

What it checks:

  • Empty or very small files
  • Missing using statements
  • Unresolved class references
  • Type mismatches
  • Missing required enums
  • Duplicate class declarations
  • Duplicate properties within classes
  • Invalid property names

When to use: After running convert-models.ps1 to ensure the conversion was successful.


convert-models.ps1 - TypeScript to C# Conversion Script

Purpose: Converts TypeScript models from the Jellyseerr source code to C# classes.

Usage:

pwsh -File scripts/convert-models.ps1

What it does:

  • Reads TypeScript files from codebase/seerr-main
  • Converts them to C# classes
  • Applies naming conventions and type mappings
  • Outputs to src/Jellyfin.Plugin.JellyBridge/JellyseerrModel/
  • Uses configuration from convert-config.psd1

When to use: When you need to update the Jellyseerr models (e.g., after Jellyseerr releases a new version with API changes).


convert-config.psd1 - Model Conversion Configuration

Purpose: Configuration file for the model conversion script.

Setup Required: Before running the convert-models script, you need to have the Jellyseerr source code:

# Clone the Jellyseerr repository
git clone https://github.com/jellyseerr/jellyseerr.git codebase/seerr-main

Contents:

  • Input/output directory mappings (codebase/seerr-main/server/* β†’ JellyseerrModel/*)
  • Type conversion rules (e.g., number to double patterns)
  • Blocked classes (classes that are too complex to convert)
  • Namespace mapping
  • JSON property generation for serialization

Note: Edit this file when you need to adjust how TypeScript models are converted to C#.


convert-permissions.ps1 - Permission Enum Conversion Script

Purpose: Converts the Jellyseerr permission enum from TypeScript into Permissions.cs.

Usage:

pwsh -File scripts/convert-permissions.ps1

What it does:

  • Reads codebase/seerr-main/server/lib/permissions.ts
  • Extracts the exported Permission enum
  • Writes src/Jellyfin.Plugin.JellyBridge/JellyseerrModel/Server/Permissions.cs

When to use: When Jellyseerr updates its permission constants and the generated C# enum needs to stay in sync. Run this after convert-models


build-branch.ps1 - Branch Release Script

Purpose: Builds and releases the plugin for a specific branch with automatic versioning.

Usage:

pwsh -File scripts/build-branch.ps1 -Changelog "Description of changes" -Branch "feature" -ReleaseType "patch"

Parameters:

  • -Changelog (optional): Description of changes in this release
  • -Branch (optional, default: β€œfeature”): Git branch to build and release
  • -ReleaseType (optional, default: β€œpatch”): Version increment type - β€œmajor”, β€œminor”, or β€œpatch”
  • -Version (optional): Specific version number (if not provided, auto-increments from latest release)

What it does:

  • Auto-calculates version from latest release if not provided
  • Builds for Jellyfin 10.10.7 (net8.0) and 10.11.0 (net9.0) and 12.0 (net10.0)
  • Creates release ZIP files with proper ABI targeting
  • Updates manifest.json with new version entries
  • Commits and pushes changes to the specified branch

When to use: For regular development releases on feature branches.


build-local.ps1 - Local Development Build Script

Purpose: Builds the plugin DLL for local testing and optionally copies to Docker test instance.

Usage:

pwsh -File scripts/build-local.ps1 [-Clean] [-Docker] [-DockerContainerName "name"] [-DockerPluginPath "path"]

Parameters:

  • -Clean: Clean previous builds before building
  • -Docker: Copy DLL to Docker test instance after build
  • -DockerContainerName: Name of Docker container (default: β€œtest-jellyfin”)
  • -DockerPluginPath: Path to plugins directory in Docker (default: Windows Docker path)

What it does:

  • Builds the plugin for Jellyfin 10.10.7 (net8.0)
  • Optionally copies DLL to Docker test instance
  • Creates meta.json for local testing

When to use: For local development and testing.


build-release.ps1 - Main Branch Release Script

Purpose: Creates an official release for the main branch with GitHub release creation.

Usage:

pwsh -File scripts/build-release.ps1 -Version "1.0.0" -Changelog "Release description" [-Release]

Parameters:

  • -Version (required): Version number in format X.Y.Z
  • -Changelog (required): Release description
  • -Release: Create GitHub release (default: false, creates draft)
  • -GitHubUsername (optional): GitHub username (default: β€œkinggeorges12”)

What it does:

  • Builds for Jellyfin 10.10.7 and 10.11.0 and 12.0
  • Creates release ZIP files
  • Updates manifest.json
  • Creates GitHub release (draft or published)
  • Commits and pushes to main branch

When to use: For official releases on the main branch.


Project Structure

Jellyfin.Plugin.JellyBridge/
β”œβ”€β”€ Assets/                       # Image assets to generate promo videos
β”‚   β”œβ”€β”€ movie.png
β”‚   β”œβ”€β”€ season.png
β”‚   └── show.png
β”œβ”€β”€ Attributes/                   # Plugin attributes
β”‚   └── JellyfinVersionAttribute.cs
β”œβ”€β”€ BridgeModels/                 # Data models
β”‚   β”œβ”€β”€ BridgeConfiguration.cs
β”‚   β”œβ”€β”€ JellyMatch.cs
β”‚   β”œβ”€β”€ JellyseerrApiResults.cs
β”‚   └── ... (other bridge models)
β”œβ”€β”€ Configuration/                # Configuration classes
β”‚   β”œβ”€β”€ ConfigurationPage.html
β”‚   β”œβ”€β”€ ConfigurationPage.js
β”‚   └── PluginConfiguration.cs
β”œβ”€β”€ Controllers/                  # REST API controllers
β”‚   β”œβ”€β”€ AdvancedSettingsController.cs
β”‚   β”œβ”€β”€ CustomizePromoController.cs
β”‚   β”œβ”€β”€ GeneralSettingsController.cs
β”‚   β”œβ”€β”€ OrganizeDiscoverLibraryController.cs
β”‚   β”œβ”€β”€ ImportDiscoverContentController.cs
β”‚   β”œβ”€β”€ ManageFavoriteRequestsController.cs
β”‚   β”œβ”€β”€ PluginConfigurationController.cs
β”‚   β”œβ”€β”€ SortDiscoverContentController.cs
β”‚   └── TaskStatusController.cs
β”œβ”€β”€ JellyfinModels/               # Jellyfin Internal API wrapper models
β”‚   β”œβ”€β”€ DateTimeSerialization.cs
β”‚   β”œβ”€β”€ IJellyfinItem.cs
β”‚   β”œβ”€β”€ JellyfinILibraryManager.cs
β”‚   β”œβ”€β”€ JellyfinIProviderManager.cs
β”‚   β”œβ”€β”€ JellyfinIUserDataManager.cs
β”‚   β”œβ”€β”€ JellyfinIUserManager.cs
β”‚   β”œβ”€β”€ JellyfinMovie.cs
β”‚   β”œβ”€β”€ JellyfinSeries.cs
β”‚   β”œβ”€β”€ JellyfinTaskTrigger.cs
β”‚   β”œβ”€β”€ JellyfinUser.cs
β”‚   β”œβ”€β”€ JellyfinWrapperResult.cs
β”‚   └── WrapperBase.cs
β”œβ”€β”€ JellyseerrModel/              # Generated API models
β”‚   β”œβ”€β”€ Api/                      # API interface definitions
β”‚   β”œβ”€β”€ Common/                   # Common models
β”‚   └── Server/                   # Server models
β”œβ”€β”€ Services/                     # Business logic services
β”‚   β”œβ”€β”€ ApiService.cs
β”‚   β”œβ”€β”€ BridgeService.cs
β”‚   β”œβ”€β”€ CleanupService.cs
β”‚   β”œβ”€β”€ DiscoverService.cs
β”‚   β”œβ”€β”€ FavoriteService.cs
β”‚   β”œβ”€β”€ FavoriteEventHandler.cs
β”‚   β”œβ”€β”€ RefreshService.cs
β”‚   β”œβ”€β”€ MetadataService.cs
β”‚   β”œβ”€β”€ PlaceholderVideoGenerator.cs
β”‚   β”œβ”€β”€ PluginServiceRegistrator.cs
β”‚   β”œβ”€β”€ SortService.cs
β”‚   └── SyncService.cs
β”œβ”€β”€ Tasks/                        # Scheduled tasks
β”‚   β”œβ”€β”€ SortTask.cs
β”‚   β”œβ”€β”€ StartupTask.cs
β”‚   └── SyncTask.cs
β”œβ”€β”€ Utils/                        # Utility classes
β”‚   β”œβ”€β”€ DebugLogger.cs
β”‚   β”œβ”€β”€ FolderUtils.cs
β”‚   └── JellyBridgeJsonSerializer.cs
β”œβ”€β”€ JellyBridge.csproj            # Project file
β”œβ”€β”€ Plugin.cs                     # Main plugin class
manifest.json                     # Plugin manifest (in project root)