From c4f587dd94a4f21e033a6643493a76e5838f283e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 12 Mar 2014 15:56:12 -0400 Subject: live tv stream adjustments, add additional dlna params --- .../FileOrganization/EpisodeFileOrganizer.cs | 12 +++++------- .../HttpServer/HttpResultFactory.cs | 14 +++++++++++++- .../Library/Resolvers/Movies/MovieResolver.cs | 15 --------------- 3 files changed, 18 insertions(+), 23 deletions(-) (limited to 'MediaBrowser.Server.Implementations') diff --git a/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs b/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs index e5ffd639b..5d326f1ca 100644 --- a/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs +++ b/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs @@ -173,25 +173,23 @@ namespace MediaBrowser.Server.Implementations.FileOrganization if (!overwriteExisting) { - if (fileExists || otherDuplicatePaths.Count > 0) + if (options.CopyOriginalFile && fileExists && IsSameEpisode(sourcePath, newPath)) { + _logger.Info("File {0} already copied to new path {1}, stopping organization", sourcePath, newPath); result.Status = FileSortingStatus.SkippedExisting; result.StatusMessage = string.Empty; - result.DuplicatePaths = otherDuplicatePaths; return; } - - if (options.CopyOriginalFile && fileExists && IsSameEpisode(sourcePath, newPath)) + + if (fileExists || otherDuplicatePaths.Count > 0) { - _logger.Info("File {0} already copied to new path {1}, stopping organization", sourcePath, newPath); result.Status = FileSortingStatus.SkippedExisting; result.StatusMessage = string.Empty; + result.DuplicatePaths = otherDuplicatePaths; return; } } - - PerformFileSorting(options, result); if (overwriteExisting) diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs index 8455d9f58..925ef8050 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -306,6 +306,18 @@ namespace MediaBrowser.Server.Implementations.HttpServer throw new ArgumentNullException("path"); } + return GetStaticFileResult(requestContext, path, MimeTypes.GetMimeType(path), fileShare, responseHeaders, isHeadRequest); + } + + public object GetStaticFileResult(IRequest requestContext, string path, string contentType, + FileShare fileShare = FileShare.Read, IDictionary responseHeaders = null, + bool isHeadRequest = false) + { + if (string.IsNullOrEmpty(path)) + { + throw new ArgumentNullException("path"); + } + if (fileShare != FileShare.Read && fileShare != FileShare.ReadWrite) { throw new ArgumentException("FileShare must be either Read or ReadWrite"); @@ -315,7 +327,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer var cacheKey = path + dateModified.Ticks; - return GetStaticResult(requestContext, cacheKey.GetMD5(), dateModified, null, MimeTypes.GetMimeType(path), () => Task.FromResult(GetFileStream(path, fileShare)), responseHeaders, isHeadRequest); + return GetStaticResult(requestContext, cacheKey.GetMD5(), dateModified, null, contentType, () => Task.FromResult(GetFileStream(path, fileShare)), responseHeaders, isHeadRequest); } /// diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index a8a4e2237..16c0d1a27 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -56,21 +56,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies { return null; } - - // If the parent is not a boxset, the only other allowed parent type is Folder - if (!(args.Parent is BoxSet)) - { - if (args.Parent.GetType() != typeof(Folder)) - { - return null; - } - } - } - - // Since the looping is expensive, this is an optimization to help us avoid it - if (args.Path.IndexOf("[tvdbid", StringComparison.OrdinalIgnoreCase) != -1) - { - return null; } var isDirectory = args.IsDirectory; -- cgit v1.2.3