Răsfoiți Sursa

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.
Joshua M. Boniface 1 an în urmă
părinte
comite
85cfd080f1

+ 3 - 1
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();
         }
     }
 }

+ 4 - 9
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

@@ -117,17 +117,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
         /// </summary>
         public void SetFFmpegPath()
         {
-            // 1) Custom path stored in config/encoding xml file under tag <EncoderAppPath> 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))