diff --git a/Emby.Naming/AudioBook/AudioBookFileInfo.cs b/Emby.Naming/AudioBook/AudioBookFileInfo.cs index 0bc6ec7e40..c4863b50ab 100644 --- a/Emby.Naming/AudioBook/AudioBookFileInfo.cs +++ b/Emby.Naming/AudioBook/AudioBookFileInfo.cs @@ -37,7 +37,7 @@ namespace Emby.Naming.AudioBook /// The type. public bool IsDirectory { get; set; } - /// + /// public int CompareTo(AudioBookFileInfo other) { if (ReferenceEquals(this, other)) diff --git a/Emby.Naming/AudioBook/AudioBookListResolver.cs b/Emby.Naming/AudioBook/AudioBookListResolver.cs index 081510f952..f4ba11a0d1 100644 --- a/Emby.Naming/AudioBook/AudioBookListResolver.cs +++ b/Emby.Naming/AudioBook/AudioBookListResolver.cs @@ -29,11 +29,7 @@ namespace Emby.Naming.AudioBook // Filter out all extras, otherwise they could cause stacks to not be resolved // See the unit test TestStackedWithTrailer var metadata = audiobookFileInfos - .Select(i => new FileSystemMetadata - { - FullName = i.Path, - IsDirectory = i.IsDirectory - }); + .Select(i => new FileSystemMetadata { FullName = i.Path, IsDirectory = i.IsDirectory }); var stackResult = new StackResolver(_options) .ResolveAudioBooks(metadata); @@ -42,11 +38,7 @@ namespace Emby.Naming.AudioBook { var stackFiles = stack.Files.Select(i => audioBookResolver.Resolve(i, stack.IsDirectoryStack)).ToList(); stackFiles.Sort(); - var info = new AudioBookInfo - { - Files = stackFiles, - Name = stack.Name - }; + var info = new AudioBookInfo { Files = stackFiles, Name = stack.Name }; yield return info; } diff --git a/Emby.Naming/Subtitles/SubtitleParser.cs b/Emby.Naming/Subtitles/SubtitleParser.cs index 082696da4f..88ec3e2d60 100644 --- a/Emby.Naming/Subtitles/SubtitleParser.cs +++ b/Emby.Naming/Subtitles/SubtitleParser.cs @@ -37,7 +37,8 @@ namespace Emby.Naming.Subtitles IsForced = _options.SubtitleForcedFlags.Any(i => flags.Contains(i, StringComparer.OrdinalIgnoreCase)) }; - var parts = flags.Where(i => !_options.SubtitleDefaultFlags.Contains(i, StringComparer.OrdinalIgnoreCase) && !_options.SubtitleForcedFlags.Contains(i, StringComparer.OrdinalIgnoreCase)) + var parts = flags.Where(i => !_options.SubtitleDefaultFlags.Contains(i, StringComparer.OrdinalIgnoreCase) + && !_options.SubtitleForcedFlags.Contains(i, StringComparer.OrdinalIgnoreCase)) .ToList(); // Should have a name, language and file extension diff --git a/Emby.Naming/TV/EpisodePathParser.cs b/Emby.Naming/TV/EpisodePathParser.cs index d3a822b173..a6af689c72 100644 --- a/Emby.Naming/TV/EpisodePathParser.cs +++ b/Emby.Naming/TV/EpisodePathParser.cs @@ -18,7 +18,13 @@ namespace Emby.Naming.TV _options = options; } - public EpisodePathParserResult Parse(string path, bool isDirectory, bool? isNamed = null, bool? isOptimistic = null, bool? supportsAbsoluteNumbers = null, bool fillExtendedInfo = true) + public EpisodePathParserResult Parse( + string path, + bool isDirectory, + bool? isNamed = null, + bool? isOptimistic = null, + bool? supportsAbsoluteNumbers = null, + bool fillExtendedInfo = true) { // Added to be able to use regex patterns which require a file extension. // There were no failed tests without this block, but to be safe, we can keep it until @@ -64,7 +70,7 @@ namespace Emby.Naming.TV { result.SeriesName = result.SeriesName .Trim() - .Trim(new[] { '_', '.', '-' }) + .Trim('_', '.', '-') .Trim(); } } diff --git a/Emby.Naming/TV/SeasonPathParserResult.cs b/Emby.Naming/TV/SeasonPathParserResult.cs index 44090c059f..a142fafea0 100644 --- a/Emby.Naming/TV/SeasonPathParserResult.cs +++ b/Emby.Naming/TV/SeasonPathParserResult.cs @@ -11,7 +11,7 @@ namespace Emby.Naming.TV public int? SeasonNumber { get; set; } /// - /// Gets or sets a value indicating whether this is success. + /// Gets or sets a value indicating whether this is success. /// /// true if success; otherwise, false. public bool Success { get; set; } diff --git a/Emby.Naming/Video/StackResolver.cs b/Emby.Naming/Video/StackResolver.cs index ee05904c75..f733cd2620 100644 --- a/Emby.Naming/Video/StackResolver.cs +++ b/Emby.Naming/Video/StackResolver.cs @@ -21,31 +21,24 @@ namespace Emby.Naming.Video public IEnumerable ResolveDirectories(IEnumerable files) { - return Resolve(files.Select(i => new FileSystemMetadata - { - FullName = i, - IsDirectory = true - })); + return Resolve(files.Select(i => new FileSystemMetadata { FullName = i, IsDirectory = true })); } public IEnumerable ResolveFiles(IEnumerable files) { - return Resolve(files.Select(i => new FileSystemMetadata - { - FullName = i, - IsDirectory = false - })); + return Resolve(files.Select(i => new FileSystemMetadata { FullName = i, IsDirectory = false })); } public IEnumerable ResolveAudioBooks(IEnumerable files) { - foreach (var directory in files.GroupBy(file => file.IsDirectory ? file.FullName : Path.GetDirectoryName(file.FullName))) + var groupedDirectoryFiles = files.GroupBy(file => + file.IsDirectory + ? file.FullName + : Path.GetDirectoryName(file.FullName)); + + foreach (var directory in groupedDirectoryFiles) { - var stack = new FileStack() - { - Name = Path.GetFileName(directory.Key), - IsDirectoryStack = false - }; + var stack = new FileStack { Name = Path.GetFileName(directory.Key), IsDirectoryStack = false }; foreach (var file in directory) { if (file.IsDirectory) diff --git a/Emby.Naming/Video/VideoFileInfo.cs b/Emby.Naming/Video/VideoFileInfo.cs index aa4f3a35c3..11e789b663 100644 --- a/Emby.Naming/Video/VideoFileInfo.cs +++ b/Emby.Naming/Video/VideoFileInfo.cs @@ -77,7 +77,9 @@ namespace Emby.Naming.Video /// Gets the file name without extension. /// /// The file name without extension. - public string FileNameWithoutExtension => !IsDirectory ? System.IO.Path.GetFileNameWithoutExtension(Path) : System.IO.Path.GetFileName(Path); + public string FileNameWithoutExtension => !IsDirectory + ? System.IO.Path.GetFileNameWithoutExtension(Path) + : System.IO.Path.GetFileName(Path); /// public override string ToString() diff --git a/Emby.Naming/Video/VideoListResolver.cs b/Emby.Naming/Video/VideoListResolver.cs index d4b02cf2a6..7f755fd25e 100644 --- a/Emby.Naming/Video/VideoListResolver.cs +++ b/Emby.Naming/Video/VideoListResolver.cs @@ -33,11 +33,7 @@ namespace Emby.Naming.Video // See the unit test TestStackedWithTrailer var nonExtras = videoInfos .Where(i => i.ExtraType == null) - .Select(i => new FileSystemMetadata - { - FullName = i.Path, - IsDirectory = i.IsDirectory - }); + .Select(i => new FileSystemMetadata { FullName = i.Path, IsDirectory = i.IsDirectory }); var stackResult = new StackResolver(_options) .Resolve(nonExtras).ToList(); @@ -57,11 +53,7 @@ namespace Emby.Naming.Video info.Year = info.Files[0].Year; - var extraBaseNames = new List - { - stack.Name, - Path.GetFileNameWithoutExtension(stack.Files[0]) - }; + var extraBaseNames = new List { stack.Name, Path.GetFileNameWithoutExtension(stack.Files[0]) }; var extras = GetExtras(remainingFiles, extraBaseNames); @@ -83,10 +75,7 @@ namespace Emby.Naming.Video foreach (var media in standaloneMedia) { - var info = new VideoInfo(media.Name) - { - Files = new List { media } - }; + var info = new VideoInfo(media.Name) { Files = new List { media } }; info.Year = info.Files[0].Year; @@ -222,8 +211,8 @@ namespace Emby.Naming.Video { testFilename = testFilename.Substring(folderName.Length).Trim(); return string.IsNullOrEmpty(testFilename) - || testFilename[0] == '-' - || string.IsNullOrWhiteSpace(Regex.Replace(testFilename, @"\[([^]]*)\]", string.Empty)); + || testFilename[0] == '-' + || string.IsNullOrWhiteSpace(Regex.Replace(testFilename, @"\[([^]]*)\]", string.Empty)); } return false; @@ -239,7 +228,8 @@ namespace Emby.Naming.Video return remainingFiles .Where(i => i.ExtraType == null) - .Where(i => baseNames.Any(b => i.FileNameWithoutExtension.StartsWith(b, StringComparison.OrdinalIgnoreCase))) + .Where(i => baseNames.Any(b => + i.FileNameWithoutExtension.StartsWith(b, StringComparison.OrdinalIgnoreCase))) .ToList(); } } diff --git a/MediaBrowser.Model/Entities/ChapterInfo.cs b/MediaBrowser.Model/Entities/ChapterInfo.cs index 2903ef61b4..bea7ec1dba 100644 --- a/MediaBrowser.Model/Entities/ChapterInfo.cs +++ b/MediaBrowser.Model/Entities/ChapterInfo.cs @@ -26,6 +26,7 @@ namespace MediaBrowser.Model.Entities /// /// The image path. public string ImagePath { get; set; } + public DateTime ImageDateModified { get; set; } public string ImageTag { get; set; }