diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-09-21 13:28:34 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-09-21 13:28:34 +0200 |
| commit | 52585a865e921196c6e47fe18b19b63107398d8d (patch) | |
| tree | d0de83526ce86768b76874391b75272a4d29b973 /MediaBrowser.MediaEncoding | |
| parent | b598f0e9fbc864b3886188659339837ee919d8b2 (diff) | |
Validate ffmpeg path
Diffstat (limited to 'MediaBrowser.MediaEncoding')
| -rw-r--r-- | MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index a7bcaf544..4cbd1bbc8 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -165,14 +165,22 @@ namespace MediaBrowser.MediaEncoding.Encoder // User had cleared the custom path in UI newPath = string.Empty; } - else if (Directory.Exists(path)) - { - // Given path is directory, so resolve down to filename - newPath = GetEncoderPathFromDirectory(path, "ffmpeg"); - } else { - newPath = path; + if (Directory.Exists(path)) + { + // Given path is directory, so resolve down to filename + newPath = GetEncoderPathFromDirectory(path, "ffmpeg"); + } + else + { + newPath = path; + } + + if (!new EncoderValidator(_logger, newPath).ValidateVersion()) + { + throw new ResourceNotFoundException(); + } } // Write the new ffmpeg path to the xml as <EncoderAppPath> |
