Browse Source

Use GetEncodingOptions where possible

Bond_009 4 years ago
parent
commit
b1fe28d0a6

+ 0 - 5
Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs

@@ -335,11 +335,6 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
             return new Uri(url).AbsoluteUri.TrimEnd('/');
         }
 
-        protected EncodingOptions GetEncodingOptions()
-        {
-            return Config.GetConfiguration<EncodingOptions>("encoding");
-        }
-
         private static string GetHdHrIdFromChannelId(string channelId)
         {
             return channelId.Split('_')[1];

+ 1 - 1
Jellyfin.Api/Models/PlaybackDtos/TranscodingThrottler.cs

@@ -98,7 +98,7 @@ namespace Jellyfin.Api.Models.PlaybackDtos
 
         private EncodingOptions GetOptions()
         {
-            return _config.GetConfiguration<EncodingOptions>("encoding");
+            return _config.GetEncodingOptions();
         }
 
         private async void TimerCallback(object? state)

+ 1 - 1
Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs

@@ -32,7 +32,7 @@ namespace Jellyfin.Server.Migrations.Routines
         public void Perform()
         {
             // Set EnableThrottling to false since it wasn't used before and may introduce issues
-            var encoding = _configManager.GetConfiguration<EncodingOptions>("encoding");
+            var encoding = _configManager.GetEncodingOptions();
             if (encoding.EnableThrottling)
             {
                 _logger.LogInformation("Disabling transcoding throttling during migration");

+ 3 - 3
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

@@ -103,7 +103,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
         public void SetFFmpegPath()
         {
             // 1) Custom path stored in config/encoding xml file under tag <EncoderAppPath> takes precedence
-            if (!ValidatePath(_configurationManager.GetConfiguration<EncodingOptions>("encoding").EncoderAppPath, FFmpegLocation.Custom))
+            if (!ValidatePath(_configurationManager.GetEncodingOptions().EncoderAppPath, FFmpegLocation.Custom))
             {
                 // 2) Check if the --ffmpeg CLI switch has been given
                 if (!ValidatePath(_startupOptionFFmpegPath, FFmpegLocation.SetByArgument))
@@ -118,7 +118,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
             }
 
             // Write the FFmpeg path to the config/encoding.xml file as <EncoderAppPathDisplay> so it appears in UI
-            var config = _configurationManager.GetConfiguration<EncodingOptions>("encoding");
+            var config = _configurationManager.GetEncodingOptions();
             config.EncoderAppPathDisplay = _ffmpegPath ?? string.Empty;
             _configurationManager.SaveConfiguration("encoding", config);
 
@@ -177,7 +177,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
 
             // Write the new ffmpeg path to the xml as <EncoderAppPath>
             // This ensures its not lost on next startup
-            var config = _configurationManager.GetConfiguration<EncodingOptions>("encoding");
+            var config = _configurationManager.GetEncodingOptions();
             config.EncoderAppPath = newPath;
             _configurationManager.SaveConfiguration("encoding", config);