diff options
| author | Bond-009 <bond.009@outlook.com> | 2021-09-25 22:24:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-25 22:24:57 +0200 |
| commit | 8858d8e59789ee3ad7b55077900d80437ef982b5 (patch) | |
| tree | b53f72bc270c09b33ff6d5eb4e57cd902ccad4a8 /MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | |
| parent | 19b8bcaec43835c698a35975a748c2129c1413aa (diff) | |
| parent | 82cb6851786d4fb24952d77d869f9e9c005a960a (diff) | |
Merge branch 'master' into theorydata
Diffstat (limited to 'MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs')
| -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> |
