< Summary - Jellyfin

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

#LineLine coverage
 1using System;
 2using MediaBrowser.Controller.Configuration;
 3using MediaBrowser.Model.System;
 4
 5namespace Jellyfin.Server.Migrations.Routines;
 6
 7/// <summary>
 8/// Migration to add the default cast receivers to the system config.
 9/// </summary>
 10public class AddDefaultCastReceivers : IMigrationRoutine
 11{
 12    private readonly IServerConfigurationManager _serverConfigurationManager;
 13
 14    /// <summary>
 15    /// Initializes a new instance of the <see cref="AddDefaultCastReceivers"/> class.
 16    /// </summary>
 17    /// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface.</p
 18    public AddDefaultCastReceivers(IServerConfigurationManager serverConfigurationManager)
 19    {
 020        _serverConfigurationManager = serverConfigurationManager;
 021    }
 22
 23    /// <inheritdoc />
 024    public Guid Id => new("34A1A1C4-5572-418E-A2F8-32CDFE2668E8");
 25
 26    /// <inheritdoc />
 027    public string Name => "AddDefaultCastReceivers";
 28
 29    /// <inheritdoc />
 030    public bool PerformOnNewInstall => true;
 31
 32    /// <inheritdoc />
 33    public void Perform()
 34    {
 035        _serverConfigurationManager.Configuration.CastReceiverApplications =
 036        [
 037            new()
 038            {
 039                Id = "F007D354",
 040                Name = "Stable"
 041            },
 042            new()
 043            {
 044                Id = "6F511C87",
 045                Name = "Unstable"
 046            }
 047        ];
 48
 049        _serverConfigurationManager.SaveConfiguration();
 050    }
 51}