From 6d983daf78e22290cf3962ccb4f87f9413a8b34a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 11 Apr 2015 17:34:05 -0400 Subject: [PATCH] updated image magick --- Emby.Drawing/Emby.Drawing.csproj | 10 +++-- Emby.Drawing/packages.config | 2 +- MediaBrowser.Controller/Entities/BaseItem.cs | 7 +--- .../LiveTv/ILiveTvService.cs | 7 ++-- .../HttpServer/HttpListenerHost.cs | 40 ++++++++++++++++++- .../LiveTv/LiveTvManager.cs | 3 +- .../MediaBrowser.ServerApplication.csproj | 2 +- .../packages.config | 2 +- 8 files changed, 53 insertions(+), 20 deletions(-) diff --git a/Emby.Drawing/Emby.Drawing.csproj b/Emby.Drawing/Emby.Drawing.csproj index 0e368d70e9..dbb976f036 100644 --- a/Emby.Drawing/Emby.Drawing.csproj +++ b/Emby.Drawing/Emby.Drawing.csproj @@ -32,8 +32,9 @@ 4 - - ..\packages\ImageMagickSharp.1.0.0.13\lib\net45\ImageMagickSharp.dll + + False + ..\packages\ImageMagickSharp.1.0.0.14\lib\net45\ImageMagickSharp.dll @@ -64,12 +65,13 @@ - + + + - diff --git a/Emby.Drawing/packages.config b/Emby.Drawing/packages.config index f1efe6e1c8..a331f20b3a 100644 --- a/Emby.Drawing/packages.config +++ b/Emby.Drawing/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index dbc0fc2827..3a43fa2ca7 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1646,16 +1646,11 @@ namespace MediaBrowser.Controller.Entities return ImageInfos.Where(i => i.Type == imageType); } - public bool AddImages(ImageType imageType, List images) + public bool AddImages(ImageType imageType, IEnumerable images) { return AddImages(imageType, images.Cast().ToList()); } - public bool AddImages(ImageType imageType, IEnumerable images) - { - return AddImages(imageType, images.ToList()); - } - /// /// Adds the images. /// diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs index d7e3df4e23..4ef4847a34 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs @@ -1,10 +1,9 @@ -using System; +using MediaBrowser.Controller.Drawing; +using MediaBrowser.Model.Dto; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Controller.Channels; -using MediaBrowser.Controller.Drawing; -using MediaBrowser.Model.Dto; namespace MediaBrowser.Controller.LiveTv { diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index f910542063..dc9656f80d 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -305,7 +305,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer var operationName = httpReq.OperationName; var localPath = url.LocalPath; - if (string.Equals(localPath, "/mediabrowser/", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(localPath, "/mediabrowser/", StringComparison.OrdinalIgnoreCase) || + string.Equals(localPath, "/emby/", StringComparison.OrdinalIgnoreCase)) { httpRes.RedirectToUrl(DefaultRedirectPath); return Task.FromResult(true); @@ -315,6 +316,11 @@ namespace MediaBrowser.Server.Implementations.HttpServer httpRes.RedirectToUrl("mediabrowser/" + DefaultRedirectPath); return Task.FromResult(true); } + if (string.Equals(localPath, "/emby", StringComparison.OrdinalIgnoreCase)) + { + httpRes.RedirectToUrl("emby/" + DefaultRedirectPath); + return Task.FromResult(true); + } if (string.Equals(localPath, "/", StringComparison.OrdinalIgnoreCase)) { httpRes.RedirectToUrl(DefaultRedirectPath); @@ -384,6 +390,12 @@ namespace MediaBrowser.Server.Implementations.HttpServer foreach (var route in clone) { + routes.Add(new RouteAttribute(NormalizeEmbyRoutePath(route.Path), route.Verbs) + { + Notes = route.Notes, + Priority = route.Priority, + Summary = route.Summary + }); routes.Add(new RouteAttribute(NormalizeRoutePath(route.Path), route.Verbs) { Notes = route.Notes, @@ -398,11 +410,37 @@ namespace MediaBrowser.Server.Implementations.HttpServer Priority = route.Priority, Summary = route.Summary }); + routes.Add(new RouteAttribute(DoubleNormalizeEmbyRoutePath(route.Path), route.Verbs) + { + Notes = route.Notes, + Priority = route.Priority, + Summary = route.Summary + }); } return routes.ToArray(); } + private string NormalizeEmbyRoutePath(string path) + { + if (path.StartsWith("/", StringComparison.OrdinalIgnoreCase)) + { + return "/emby" + path; + } + + return "emby/" + path; + } + + private string DoubleNormalizeEmbyRoutePath(string path) + { + if (path.StartsWith("/", StringComparison.OrdinalIgnoreCase)) + { + return "/emby/emby" + path; + } + + return "emby/emby/" + path; + } + private string NormalizeRoutePath(string path) { if (path.StartsWith("/", StringComparison.OrdinalIgnoreCase)) diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 3aacc8f3b6..3d486b90da 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -1212,8 +1212,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv var days = Math.Round(((double)maxPrograms) / programsPerDay); - // No less than 2, no more than 7 - return Math.Max(2, Math.Min(days, 7)); + return Math.Max(3, Math.Min(days, 14)); } private async Task>> GetChannels(ILiveTvService service, CancellationToken cancellationToken) diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index e96f2c89ff..e118e25d1f 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -62,7 +62,7 @@ False - ..\packages\ImageMagickSharp.1.0.0.13\lib\net45\ImageMagickSharp.dll + ..\packages\ImageMagickSharp.1.0.0.14\lib\net45\ImageMagickSharp.dll ..\packages\MediaBrowser.IsoMounting.3.0.69\lib\net45\MediaBrowser.IsoMounter.dll diff --git a/MediaBrowser.ServerApplication/packages.config b/MediaBrowser.ServerApplication/packages.config index 2e984af6a1..06379542ed 100644 --- a/MediaBrowser.ServerApplication/packages.config +++ b/MediaBrowser.ServerApplication/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file