< Summary - Jellyfin

Information
Class: Jellyfin.Server.Migrations.Routines.AddDefaultCastReceivers
Assembly: jellyfin
File(s): /srv/git/jellyfin/Jellyfin.Server/Migrations/Routines/AddDefaultCastReceivers.cs
Line coverage
100%
Covered lines: 17
Uncovered lines: 0
Coverable lines: 17
Total lines: 45
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/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>
 10#pragma warning disable CS0618 // Type or member is obsolete
 11[JellyfinMigration("2025-04-20T16:00:00", nameof(AddDefaultCastReceivers), "34A1A1C4-5572-418E-A2F8-32CDFE2668E8", RunMi
 12public class AddDefaultCastReceivers : IMigrationRoutine
 13#pragma warning restore CS0618 // Type or member is obsolete
 14{
 15    private readonly IServerConfigurationManager _serverConfigurationManager;
 16
 17    /// <summary>
 18    /// Initializes a new instance of the <see cref="AddDefaultCastReceivers"/> class.
 19    /// </summary>
 20    /// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface.</p
 21    public AddDefaultCastReceivers(IServerConfigurationManager serverConfigurationManager)
 22    {
 2123        _serverConfigurationManager = serverConfigurationManager;
 2124    }
 25
 26    /// <inheritdoc />
 27    public void Perform()
 28    {
 2129        _serverConfigurationManager.Configuration.CastReceiverApplications =
 2130        [
 2131            new()
 2132            {
 2133                Id = "F007D354",
 2134                Name = "Stable"
 2135            },
 2136            new()
 2137            {
 2138                Id = "6F511C87",
 2139                Name = "Unstable"
 2140            }
 2141        ];
 42
 2143        _serverConfigurationManager.SaveConfiguration();
 2144    }
 45}