< Summary - Jellyfin

Information
Class: Jellyfin.Server.Migrations.Routines.DisableTranscodingThrottling
Assembly: jellyfin
File(s): /srv/git/jellyfin/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 38
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
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%
Perform()0%620%

File(s)

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

#LineLine coverage
 1using System;
 2using MediaBrowser.Common.Configuration;
 3using Microsoft.Extensions.Logging;
 4
 5namespace Jellyfin.Server.Migrations.Routines
 6{
 7    /// <summary>
 8    /// Disable transcode throttling for all installations since it is currently broken for certain video formats.
 9    /// </summary>
 10#pragma warning disable CS0618 // Type or member is obsolete
 11    [JellyfinMigration("2025-04-20T05:00:00", nameof(DisableTranscodingThrottling), "4124C2CD-E939-4FFB-9BE9-9B311C41363
 12    internal class DisableTranscodingThrottling : IMigrationRoutine
 13#pragma warning restore CS0618 // Type or member is obsolete
 14    {
 15        private readonly ILogger<DisableTranscodingThrottling> _logger;
 16        private readonly IConfigurationManager _configManager;
 17
 18        public DisableTranscodingThrottling(ILogger<DisableTranscodingThrottling> logger, IConfigurationManager configMa
 19        {
 020            _logger = logger;
 021            _configManager = configManager;
 022        }
 23
 24        /// <inheritdoc/>
 25        public void Perform()
 26        {
 27            // Set EnableThrottling to false since it wasn't used before and may introduce issues
 028            var encoding = _configManager.GetEncodingOptions();
 029            if (encoding.EnableThrottling)
 30            {
 031                _logger.LogInformation("Disabling transcoding throttling during migration");
 032                encoding.EnableThrottling = false;
 33
 034                _configManager.SaveConfiguration("encoding", encoding);
 35            }
 036        }
 37    }
 38}