< 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: 12
Coverable lines: 12
Total lines: 44
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%
get_Id()100%210%
get_Name()100%210%
get_PerformOnNewInstall()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    internal class DisableTranscodingThrottling : IMigrationRoutine
 11    {
 12        private readonly ILogger<DisableTranscodingThrottling> _logger;
 13        private readonly IConfigurationManager _configManager;
 14
 15        public DisableTranscodingThrottling(ILogger<DisableTranscodingThrottling> logger, IConfigurationManager configMa
 16        {
 017            _logger = logger;
 018            _configManager = configManager;
 019        }
 20
 21        /// <inheritdoc/>
 022        public Guid Id => Guid.Parse("{4124C2CD-E939-4FFB-9BE9-9B311C413638}");
 23
 24        /// <inheritdoc/>
 025        public string Name => "DisableTranscodingThrottling";
 26
 27        /// <inheritdoc/>
 028        public bool PerformOnNewInstall => false;
 29
 30        /// <inheritdoc/>
 31        public void Perform()
 32        {
 33            // Set EnableThrottling to false since it wasn't used before and may introduce issues
 034            var encoding = _configManager.GetEncodingOptions();
 035            if (encoding.EnableThrottling)
 36            {
 037                _logger.LogInformation("Disabling transcoding throttling during migration");
 038                encoding.EnableThrottling = false;
 39
 040                _configManager.SaveConfiguration("encoding", encoding);
 41            }
 042        }
 43    }
 44}