< Summary - Jellyfin

Information
Class: Jellyfin.Server.Migrations.Routines.AddDefaultPluginRepository
Assembly: jellyfin
File(s): /srv/git/jellyfin/Jellyfin.Server/Migrations/Routines/20250420090000_AddDefaultPluginRepository.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 41
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 5/31/2026 - 12:15:44 AM Line coverage: 100% (10/10) Total lines: 3911/13/2026 - 12:19:51 AM Line coverage: 100% (10/10) Total lines: 41

Coverage delta

Coverage delta 1 -1

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
PerformAsync(...)100%11100%

File(s)

/srv/git/jellyfin/Jellyfin.Server/Migrations/Routines/20250420090000_AddDefaultPluginRepository.cs

#LineLine coverage
 1using System;
 2using System.Threading;
 3using System.Threading.Tasks;
 4using MediaBrowser.Controller.Configuration;
 5using MediaBrowser.Model.Updates;
 6
 7namespace Jellyfin.Server.Migrations.Routines
 8{
 9    /// <summary>
 10    /// Migration to initialize system configuration with the default plugin repository.
 11    /// </summary>
 12    [JellyfinMigration("2025-04-20T09:00:00", nameof(AddDefaultPluginRepository), "EB58EBEE-9514-4B9B-8225-12E1A40020DF"
 13    public class AddDefaultPluginRepository : IAsyncMigrationRoutine
 14    {
 15        private readonly IServerConfigurationManager _serverConfigurationManager;
 16
 2717        private readonly RepositoryInfo _defaultRepositoryInfo = new RepositoryInfo
 2718        {
 2719            Name = "Jellyfin Stable",
 2720            Url = "https://repo.jellyfin.org/releases/plugin/manifest-stable.json"
 2721        };
 22
 23        /// <summary>
 24        /// Initializes a new instance of the <see cref="AddDefaultPluginRepository"/> class.
 25        /// </summary>
 26        /// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface
 27        public AddDefaultPluginRepository(IServerConfigurationManager serverConfigurationManager)
 28        {
 2729            _serverConfigurationManager = serverConfigurationManager;
 2730        }
 31
 32        /// <inheritdoc/>
 33        public Task PerformAsync(CancellationToken cancellationToken)
 34        {
 2735            _serverConfigurationManager.Configuration.PluginRepositories = new[] { _defaultRepositoryInfo };
 2736            _serverConfigurationManager.SaveConfiguration();
 37
 2738            return Task.CompletedTask;
 39        }
 40    }
 41}