From 91e99effc9b8dd1e34d4e53e732fe71f1423006c Mon Sep 17 00:00:00 2001 From: Vasily Date: Tue, 29 Jan 2019 14:45:07 +0100 Subject: [PATCH] Apply suggestions from code review for flipped conditions. Co-Authored-By: EraYaN --- .../Configuration/EncodingConfigurationFactory.cs | 2 +- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 2 +- MediaBrowser.Providers/TV/MissingEpisodeProvider.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Configuration/EncodingConfigurationFactory.cs b/MediaBrowser.MediaEncoding/Configuration/EncodingConfigurationFactory.cs index c20d73dc73..bb806ee55c 100644 --- a/MediaBrowser.MediaEncoding/Configuration/EncodingConfigurationFactory.cs +++ b/MediaBrowser.MediaEncoding/Configuration/EncodingConfigurationFactory.cs @@ -46,7 +46,7 @@ namespace MediaBrowser.MediaEncoding.Configuration && !string.Equals(oldEncodingConfig.TranscodingTempPath ?? string.Empty, newPath)) { // Validate - if (Directory.Exists(newPath)) + if (!Directory.Exists(newPath)) { throw new FileNotFoundException(string.Format("{0} does not exist.", newPath)); } diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 7bcb1e38af..54344424de 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -214,7 +214,7 @@ namespace MediaBrowser.MediaEncoding.Encoder throw new ArgumentNullException(nameof(path)); } - if (!File.Exists(path) && Directory.Exists(path)) + if (!File.Exists(path) && !Directory.Exists(path)) { throw new ResourceNotFoundException(); } diff --git a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs index fcdea33d01..4ac0123999 100644 --- a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs @@ -58,7 +58,7 @@ namespace MediaBrowser.Providers.TV } // Check this in order to avoid logging an exception due to directory not existing - if (Directory.Exists(seriesDataPath)) + if (!Directory.Exists(seriesDataPath)) { return false; }