소스 검색

Merge pull request #6544 from cvium/fix_ffmpeg_path_updating

Bond-009 3 년 전
부모
커밋
ca217270b7
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 1
      MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

+ 10 - 1
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

@@ -147,6 +147,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
         /// <param name="pathType">The path type.</param>
         public void UpdateEncoderPath(string path, string pathType)
         {
+            var config = _configurationManager.GetEncodingOptions();
+
+            // Filesystem may not be case insensitive, but EncoderAppPathDisplay should always point to a valid file?
+            if (string.IsNullOrEmpty(config.EncoderAppPath)
+                && string.Equals(config.EncoderAppPathDisplay, path, StringComparison.OrdinalIgnoreCase))
+            {
+                _logger.LogDebug("Existing ffmpeg path is empty and the new path is the same as {EncoderAppPathDisplay}. Skipping", nameof(config.EncoderAppPathDisplay));
+                return;
+            }
+
             string newPath;
 
             _logger.LogInformation("Attempting to update encoder path to {Path}. pathType: {PathType}", path ?? string.Empty, pathType ?? string.Empty);
@@ -181,7 +191,6 @@ 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.GetEncodingOptions();
             config.EncoderAppPath = newPath;
             _configurationManager.SaveConfiguration("encoding", config);