From c5b00dec8ec326bbb17cf122263b78851ce398dd Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 16 Jun 2013 15:02:57 -0400 Subject: [PATCH] Added multi-disc movie support --- .../Entities/Movies/Movie.cs | 8 +- .../Entities/MusicVideo.cs | 4 +- MediaBrowser.Controller/Entities/Video.cs | 44 +++--- .../Resolvers/EntityResolutionHelper.cs | 8 +- .../Library/Resolvers/Movies/MovieResolver.cs | 127 ++++++++++++------ .../Resolvers/MovieResolverTests.cs | 27 ++++ 6 files changed, 152 insertions(+), 66 deletions(-) diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 2e9cc3bea..307fe1954 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -20,7 +20,7 @@ namespace MediaBrowser.Controller.Entities.Movies { SpecialFeatureIds = new List(); } - + /// /// Should be overridden to return the proper folder where metadata lives /// @@ -30,7 +30,7 @@ namespace MediaBrowser.Controller.Entities.Movies { get { - return VideoType == VideoType.VideoFile || VideoType == VideoType.Iso ? System.IO.Path.GetDirectoryName(Path) : Path; + return VideoType == VideoType.VideoFile || VideoType == VideoType.Iso || IsMultiPart ? System.IO.Path.GetDirectoryName(Path) : Path; } } @@ -51,7 +51,7 @@ namespace MediaBrowser.Controller.Entities.Movies { get { - return VideoType == VideoType.VideoFile || VideoType == VideoType.Iso; + return VideoType == VideoType.VideoFile || VideoType == VideoType.Iso || IsMultiPart; } } @@ -88,7 +88,7 @@ namespace MediaBrowser.Controller.Entities.Movies return itemsChanged || results.Contains(true); } - + /// /// Loads the special features. /// diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.cs index 983ce1567..035709bb4 100644 --- a/MediaBrowser.Controller/Entities/MusicVideo.cs +++ b/MediaBrowser.Controller/Entities/MusicVideo.cs @@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Entities { get { - return VideoType == VideoType.VideoFile || VideoType == VideoType.Iso ? System.IO.Path.GetDirectoryName(Path) : Path; + return VideoType == VideoType.VideoFile || VideoType == VideoType.Iso || IsMultiPart ? System.IO.Path.GetDirectoryName(Path) : Path; } } @@ -35,7 +35,7 @@ namespace MediaBrowser.Controller.Entities { get { - return VideoType == VideoType.VideoFile || VideoType == VideoType.Iso; + return VideoType == VideoType.VideoFile || VideoType == VideoType.Iso || IsMultiPart; } } } diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index a15362037..d8d700d64 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -86,7 +86,7 @@ namespace MediaBrowser.Controller.Entities var allFiles = Directory.EnumerateFiles(rootPath, "*", SearchOption.AllDirectories).ToList(); - return PlayableStreamFileNames.Select(name => allFiles.FirstOrDefault(f => string.Equals(System.IO.Path.GetFileName(f), name, System.StringComparison.OrdinalIgnoreCase))) + return PlayableStreamFileNames.Select(name => allFiles.FirstOrDefault(f => string.Equals(System.IO.Path.GetFileName(f), name, StringComparison.OrdinalIgnoreCase))) .Where(f => !string.IsNullOrEmpty(f)) .ToList(); } @@ -176,32 +176,38 @@ namespace MediaBrowser.Controller.Entities return new List