< Summary - Jellyfin

Information
Class: Jellyfin.Server.Migrations.Routines.AddDefaultPluginRepository
Assembly: jellyfin
File(s): /srv/git/jellyfin/Jellyfin.Server/Migrations/Routines/AddDefaultPluginRepository.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 39
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

Metrics

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

File(s)

/srv/git/jellyfin/Jellyfin.Server/Migrations/Routines/AddDefaultPluginRepository.cs

#LineLine coverage
 1using System;
 2using MediaBrowser.Controller.Configuration;
 3using MediaBrowser.Model.Updates;
 4
 5namespace Jellyfin.Server.Migrations.Routines
 6{
 7    /// <summary>
 8    /// Migration to initialize system configuration with the default plugin repository.
 9    /// </summary>
 10#pragma warning disable CS0618 // Type or member is obsolete
 11    [JellyfinMigration("2025-04-20T09:00:00", nameof(AddDefaultPluginRepository), "EB58EBEE-9514-4B9B-8225-12E1A40020DF"
 12    public class AddDefaultPluginRepository : IMigrationRoutine
 13#pragma warning restore CS0618 // Type or member is obsolete
 14    {
 15        private readonly IServerConfigurationManager _serverConfigurationManager;
 16
 2117        private readonly RepositoryInfo _defaultRepositoryInfo = new RepositoryInfo
 2118        {
 2119            Name = "Jellyfin Stable",
 2120            Url = "https://repo.jellyfin.org/releases/plugin/manifest-stable.json"
 2121        };
 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        {
 2129            _serverConfigurationManager = serverConfigurationManager;
 2130        }
 31
 32        /// <inheritdoc/>
 33        public void Perform()
 34        {
 2135            _serverConfigurationManager.Configuration.PluginRepositories = new[] { _defaultRepositoryInfo };
 2136            _serverConfigurationManager.SaveConfiguration();
 2137        }
 38    }
 39}