| | 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 | | 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 | | { |
| 0 | 17 | | _logger = logger; |
| 0 | 18 | | _configManager = configManager; |
| 0 | 19 | | } |
| | 20 | |
|
| | 21 | | /// <inheritdoc/> |
| 0 | 22 | | public Guid Id => Guid.Parse("{4124C2CD-E939-4FFB-9BE9-9B311C413638}"); |
| | 23 | |
|
| | 24 | | /// <inheritdoc/> |
| 0 | 25 | | public string Name => "DisableTranscodingThrottling"; |
| | 26 | |
|
| | 27 | | /// <inheritdoc/> |
| 0 | 28 | | 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 |
| 0 | 34 | | var encoding = _configManager.GetEncodingOptions(); |
| 0 | 35 | | if (encoding.EnableThrottling) |
| | 36 | | { |
| 0 | 37 | | _logger.LogInformation("Disabling transcoding throttling during migration"); |
| 0 | 38 | | encoding.EnableThrottling = false; |
| | 39 | |
|
| 0 | 40 | | _configManager.SaveConfiguration("encoding", encoding); |
| | 41 | | } |
| 0 | 42 | | } |
| | 43 | | } |
| | 44 | | } |