diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 2d45407138..ac9b42efb2 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -1,7 +1,6 @@ using MediaBrowser.Common.Extensions; using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; @@ -365,24 +364,23 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies /// /// The movies. /// ``0. - private T GetMultiFileMovie(List movies) + private T GetMultiFileMovie(IEnumerable movies) where T : Video, new() { - var multiPartMovies = movies.OrderBy(i => i.Path) - .Where(i => EntityResolutionHelper.IsMultiPartFile(i.Path)) - .ToList(); + var sortedMovies = movies.OrderBy(i => i.Path).ToList(); - // They must all be part of the sequence - if (multiPartMovies.Count != movies.Count) - { - return null; - } + var firstMovie = sortedMovies[0]; - var firstPart = multiPartMovies[0]; + // They must all be part of the sequence if we're going to consider it a multi-part movie + // Only support up to 8 (matches Plex), to help avoid incorrect detection + if (sortedMovies.All(i => EntityResolutionHelper.IsMultiPartFile(i.Path)) && sortedMovies.Count <= 8) + { + firstMovie.IsMultiPart = true; - firstPart.IsMultiPart = true; + return firstMovie; + } - return firstPart; + return null; } /// diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index f8a6b7610e..85aeeb129d 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -298,6 +298,24 @@ namespace MediaBrowser.ServerApplication { // Not there, no big deal } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tmdb-tv"), true); + } + catch (IOException) + { + // Not there, no big deal + } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tmdb-collections"), true); + } + catch (IOException) + { + // Not there, no big deal + } }); }