< Summary - Jellyfin

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

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    public class AddDefaultPluginRepository : IMigrationRoutine
 11    {
 12        private readonly IServerConfigurationManager _serverConfigurationManager;
 13
 014        private readonly RepositoryInfo _defaultRepositoryInfo = new RepositoryInfo
 015        {
 016            Name = "Jellyfin Stable",
 017            Url = "https://repo.jellyfin.org/releases/plugin/manifest-stable.json"
 018        };
 19
 20        /// <summary>
 21        /// Initializes a new instance of the <see cref="AddDefaultPluginRepository"/> class.
 22        /// </summary>
 23        /// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface
 24        public AddDefaultPluginRepository(IServerConfigurationManager serverConfigurationManager)
 25        {
 026            _serverConfigurationManager = serverConfigurationManager;
 027        }
 28
 29        /// <inheritdoc/>
 030        public Guid Id => Guid.Parse("EB58EBEE-9514-4B9B-8225-12E1A40020DF");
 31
 32        /// <inheritdoc/>
 033        public string Name => "AddDefaultPluginRepository";
 34
 35        /// <inheritdoc/>
 036        public bool PerformOnNewInstall => true;
 37
 38        /// <inheritdoc/>
 39        public void Perform()
 40        {
 041            _serverConfigurationManager.Configuration.PluginRepositories = new[] { _defaultRepositoryInfo };
 042            _serverConfigurationManager.SaveConfiguration();
 043        }
 44    }
 45}