The Free Software Media System - Server Backend & API
Apply suggestions from code review
martinek-stepan496923719c40
diff --git a/Emby.Naming/AudioBook/AudioBookListResolver.cs b/Emby.Naming/AudioBook/AudioBookListResolver.csindex b203f99022..54c1fe5bd3 100644--- a/Emby.Naming/AudioBook/AudioBookListResolver.cs+++ b/Emby.Naming/AudioBook/AudioBookListResolver.cs@@ -33,7 +33,7 @@ namespace Emby.Naming.AudioBook{var audioBookResolver = new AudioBookResolver(_options);- // File with empty fullname will be sorted out here+ // File with empty fullname will be sorted out here.var audiobookFileInfos = files.Select(i => audioBookResolver.Resolve(i.FullName)).OfType<AudioBookFileInfo>()@@ -139,8 +139,8 @@ namespace Emby.Naming.AudioBookprivate AudioBookFileInfo FindMainAudioBookFile(List<AudioBookFileInfo> files, string name){- var main = files.Find(x => Path.GetFileNameWithoutExtension(x.Path) == name);- main ??= files.FirstOrDefault(x => Path.GetFileNameWithoutExtension(x.Path) == "audiobook");+ var main = files.Find(x => Path.GetFileNameWithoutExtension(x.Path).Equals(name));+ main ??= files.FirstOrDefault(x => Path.GetFileNameWithoutExtension(x.Path).Equals("audiobook"));main ??= files.OrderBy(x => x.Container).ThenBy(x => x.Path).First();diff --git a/Emby.Naming/Video/VideoListResolver.cs b/Emby.Naming/Video/VideoListResolver.csindex ee0e4d4659..1e18c4452d 100644--- a/Emby.Naming/Video/VideoListResolver.cs+++ b/Emby.Naming/Video/VideoListResolver.cs@@ -147,7 +147,7 @@ namespace Emby.Naming.Video}// If there's only one video, accept all trailers- // Be lenient because people use all kinds of mishmash conventions with trailers+ // Be lenient because people use all kinds of mishmash conventions with trailers.if (list.Count == 1){var trailers = remainingFiles@@ -231,7 +231,7 @@ namespace Emby.Naming.VideotestFilename = testFilename.Substring(folderName.Length).Trim();return string.IsNullOrEmpty(testFilename)|| testFilename[0] == '-'- || testFilename[0] == '_'+ || testFilename[0].Equals( '_')|| string.IsNullOrWhiteSpace(Regex.Replace(testFilename, @"\[([^]]*)\]", string.Empty));}