From 830c326c3e58b92209e4a8f0071ff48e3a137360 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 20 Feb 2014 12:49:07 -0500 Subject: [PATCH] comments --- .../Library/Resolvers/Movies/MovieResolver.cs | 24 +++++++++---------- .../ApplicationHost.cs | 18 ++++++++++++++ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 2d4540713..ac9b42efb 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) + var firstMovie = sortedMovies[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) { - return null; + firstMovie.IsMultiPart = true; + + return firstMovie; } - var firstPart = multiPartMovies[0]; - - firstPart.IsMultiPart = true; - - return firstPart; + return null; } /// diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index f8a6b7610..85aeeb129 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 + } }); }