| | | 1 | | using System; |
| | | 2 | | using MediaBrowser.Common.Configuration; |
| | | 3 | | using Microsoft.Extensions.Logging; |
| | | 4 | | |
| | | 5 | | namespace 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 | | { |
| | 0 | 20 | | _logger = logger; |
| | 0 | 21 | | _configManager = configManager; |
| | 0 | 22 | | } |
| | | 23 | | |
| | | 24 | | /// <inheritdoc/> |
| | | 25 | | public void Perform() |
| | | 26 | | { |
| | | 27 | | // Set EnableThrottling to false since it wasn't used before and may introduce issues |
| | 0 | 28 | | var encoding = _configManager.GetEncodingOptions(); |
| | 0 | 29 | | if (encoding.EnableThrottling) |
| | | 30 | | { |
| | 0 | 31 | | _logger.LogInformation("Disabling transcoding throttling during migration"); |
| | 0 | 32 | | encoding.EnableThrottling = false; |
| | | 33 | | |
| | 0 | 34 | | _configManager.SaveConfiguration("encoding", encoding); |
| | | 35 | | } |
| | 0 | 36 | | } |
| | | 37 | | } |
| | | 38 | | } |