From 85cfd080f162456719f560837d797fc70c0308e5 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 22 Nov 2023 19:00:21 -0500 Subject: [PATCH] Remove the functionality of /System/MediaEncoder/Path Eliminate this endpoint by having it perform no action, pending total removal in the next major version (10.9.0). Further, adjust the MediaEncoder startup options to completely ignore what is in the XML currently, and respect only the "--ffmpeg" arg, which is set on most of our platforms, falling back to system "ffmpeg" in $PATH if not found. This ensures that, should the "--ffmpeg" arg be changed by an administrator wishing to alter the default FFmpeg binary, this change will be reflected properly on next startup. --- Jellyfin.Api/Controllers/ConfigurationController.cs | 4 +++- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 13 ++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Jellyfin.Api/Controllers/ConfigurationController.cs b/Jellyfin.Api/Controllers/ConfigurationController.cs index 464fadc060..7b3d05c100 100644 --- a/Jellyfin.Api/Controllers/ConfigurationController.cs +++ b/Jellyfin.Api/Controllers/ConfigurationController.cs @@ -130,8 +130,10 @@ namespace Jellyfin.Api.Controllers [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult UpdateMediaEncoderPath([FromBody, Required] MediaEncoderPathDto mediaEncoderPath) { - _mediaEncoder.UpdateEncoderPath(mediaEncoderPath.Path, mediaEncoderPath.PathType); + // API ENDPOINT DISABLED (NOOP) FOR SECURITY PURPOSES return NoContent(); + //_mediaEncoder.UpdateEncoderPath(mediaEncoderPath.Path, mediaEncoderPath.PathType); + //return NoContent(); } } } diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 539996c3ae..da4920d40b 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -117,17 +117,12 @@ namespace MediaBrowser.MediaEncoding.Encoder /// public void SetFFmpegPath() { - // 1) Custom path stored in config/encoding xml file under tag takes precedence - var ffmpegPath = _configurationManager.GetEncodingOptions().EncoderAppPath; + // 1) Check if the --ffmpeg CLI switch has been given + var ffmpegPath = _startupOptionFFmpegPath; if (string.IsNullOrEmpty(ffmpegPath)) { - // 2) Check if the --ffmpeg CLI switch has been given - ffmpegPath = _startupOptionFFmpegPath; - if (string.IsNullOrEmpty(ffmpegPath)) - { - // 3) Check "ffmpeg" - ffmpegPath = "ffmpeg"; - } + // 2) Check "ffmpeg" + ffmpegPath = "ffmpeg"; } if (!ValidatePath(ffmpegPath))