From bcdfb6302d5e24a7dbb071fdfb43cefaa81236c4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 12 May 2017 14:21:26 -0400 Subject: [PATCH 01/25] 3.2.16.1 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 1ef530ece0..4c7f11ce28 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.15.5")] +[assembly: AssemblyVersion("3.2.16.1")] From 382cff793eadec65fb0e732a6484f744f9237b03 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 12 May 2017 14:36:57 -0400 Subject: [PATCH 02/25] update mac project --- MediaBrowser.Server.Mac/Emby.Server.Mac.csproj | 6 ------ 1 file changed, 6 deletions(-) diff --git a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj index 73626328a2..a86e58ee02 100644 --- a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj +++ b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj @@ -923,12 +923,6 @@ Resources\dashboard-ui\bower_components\emby-webcomponents\emby-textarea\emby-textarea.js - - Resources\dashboard-ui\bower_components\emby-webcomponents\emby-toggle\emby-toggle.css - - - Resources\dashboard-ui\bower_components\emby-webcomponents\emby-toggle\emby-toggle.js - Resources\dashboard-ui\bower_components\emby-webcomponents\fonts\material-icons\2fcryfnatjcs6g4u3t-y5ewrjpiaoeww8aihgqwrjao.woff From 36d304f1156677501fff434010c55b8904afc1f2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 12 May 2017 14:41:24 -0400 Subject: [PATCH 03/25] update mac project --- MediaBrowser.Server.Mac/Emby.Server.Mac.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj index a86e58ee02..fa95fe9359 100644 --- a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj +++ b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj @@ -1034,6 +1034,9 @@ Resources\dashboard-ui\bower_components\emby-webcomponents\lazyloader\lazyloader-intersectionobserver.js + + Resources\dashboard-ui\bower_components\emby-webcomponents\lazyloader\lazyedgehack.css + Resources\dashboard-ui\bower_components\emby-webcomponents\lazyloader\lazyloader-scroll.js From d38d4563b39e86d0275268829748241befc1a115 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 12 May 2017 22:10:01 -0400 Subject: [PATCH 04/25] update mac project --- MediaBrowser.Server.Mac/Emby.Server.Mac.csproj | 7 +++++++ MediaBrowser.Server.Mac/packages.config | 1 + 2 files changed, 8 insertions(+) diff --git a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj index fa95fe9359..89eea23593 100644 --- a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj +++ b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj @@ -121,6 +121,9 @@ ..\ThirdParty\taglib\TagLib.Portable.dll + + ..\packages\SkiaSharp.1.57.1\lib\net45\SkiaSharp.dll + ..\packages\SQLitePCLRaw.core.1.1.5\lib\net45\SQLitePCLRaw.core.dll @@ -225,6 +228,10 @@ {C97A239E-A96C-4D64-A844-CCF8CC30AECB} Emby.Drawing.Net + + {2312da6d-ff86-4597-9777-bceec32d96dd} + Emby.Drawing.Skia + {6CFEE013-6E7C-432B-AC37-CABF0880C69A} Emby.Drawing.ImageMagick diff --git a/MediaBrowser.Server.Mac/packages.config b/MediaBrowser.Server.Mac/packages.config index a87b88341d..98f56960b2 100644 --- a/MediaBrowser.Server.Mac/packages.config +++ b/MediaBrowser.Server.Mac/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file From 6ef6a1f035fe2b4535167518a9a75fbaf6ce2e37 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 12 May 2017 22:12:52 -0400 Subject: [PATCH 05/25] update mac project --- MediaBrowser.Server.Mac/Emby.Server.Mac.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj index 89eea23593..b19b736077 100644 --- a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj +++ b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj @@ -232,10 +232,6 @@ {2312da6d-ff86-4597-9777-bceec32d96dd} Emby.Drawing.Skia - - {6CFEE013-6E7C-432B-AC37-CABF0880C69A} - Emby.Drawing.ImageMagick - {08FFF49B-F175-4807-A2B5-73B0EBD9F716} Emby.Drawing From 045f93f1096f955ed682f7325051caec5fe48265 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 13 May 2017 00:05:13 -0400 Subject: [PATCH 06/25] update mac project --- MediaBrowser.Server.Mac/Emby.Server.Mac.csproj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj index b19b736077..8a1c96aded 100644 --- a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj +++ b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj @@ -2704,7 +2704,7 @@ - + Dynamic False @@ -2712,5 +2712,9 @@ Dynamic False + + Dynamic + False + \ No newline at end of file From 05c678249b6643275edf70a6a321e0070b391d0d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 13 May 2017 00:08:27 -0400 Subject: [PATCH 07/25] update mac project --- MediaBrowser.Server.Mac.sln | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/MediaBrowser.Server.Mac.sln b/MediaBrowser.Server.Mac.sln index bc7cba21f8..5568b8455d 100644 --- a/MediaBrowser.Server.Mac.sln +++ b/MediaBrowser.Server.Mac.sln @@ -47,6 +47,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RSSDP", "RSSDP\RSSDP.csproj EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketHttpListener.Portable", "SocketHttpListener.Portable\SocketHttpListener.Portable.csproj", "{4F26D5D8-A7B0-42B3-BA42-7CB7D245934E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Drawing.Skia", "Emby.Drawing.Skia\Emby.Drawing.Skia.csproj", "{2312DA6D-FF86-4597-9777-BCEEC32D96DD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution AppStore|Any CPU = AppStore|Any CPU @@ -498,6 +500,46 @@ Global {4F26D5D8-A7B0-42B3-BA42-7CB7D245934E}.Signed|Any CPU.Build.0 = Release|Any CPU {4F26D5D8-A7B0-42B3-BA42-7CB7D245934E}.Signed|x86.ActiveCfg = Release|Any CPU {4F26D5D8-A7B0-42B3-BA42-7CB7D245934E}.Signed|x86.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Debug|Win32.Build.0 = Debug|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Debug|x64.ActiveCfg = Debug|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Debug|x64.Build.0 = Debug|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Debug|x86.ActiveCfg = Debug|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Debug|x86.Build.0 = Debug|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release Mono|Any CPU.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release Mono|Any CPU.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release Mono|Mixed Platforms.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release Mono|Mixed Platforms.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release Mono|Win32.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release Mono|Win32.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release Mono|x64.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release Mono|x64.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release Mono|x86.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release Mono|x86.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release|Any CPU.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release|Win32.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release|Win32.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release|x64.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release|x64.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release|x86.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Release|x86.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Signed|Any CPU.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Signed|Any CPU.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Signed|Mixed Platforms.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Signed|Mixed Platforms.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Signed|Win32.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Signed|Win32.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Signed|x64.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Signed|x64.Build.0 = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Signed|x86.ActiveCfg = Release|Any CPU + {2312DA6D-FF86-4597-9777-BCEEC32D96DD}.Signed|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 55e8a612185fae11a77f5d2e9bb01a7cfeb0839d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 13 May 2017 00:26:39 -0400 Subject: [PATCH 08/25] update mac project --- MediaBrowser.Server.Mac/Main.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Server.Mac/Main.cs b/MediaBrowser.Server.Mac/Main.cs index 932ff61055..8a3a6cdbab 100644 --- a/MediaBrowser.Server.Mac/Main.cs +++ b/MediaBrowser.Server.Mac/Main.cs @@ -32,7 +32,10 @@ using Mono.Unix.Native; using MediaBrowser.Model.System; using MediaBrowser.Model.IO; using Emby.Server.Core.Logging; -using Emby.Drawing.Net; +using Emby.Drawing; +using Emby.Drawing.Skia; +using MediaBrowser.Controller.Drawing; +using MediaBrowser.Model.Drawing; namespace MediaBrowser.Server.Mac { @@ -112,7 +115,7 @@ namespace MediaBrowser.Server.Mac _fileSystem = fileSystem; - var imageEncoder = new GDIImageEncoder(fileSystem, logManager.GetLogger("GDI")); + var imageEncoder = GetImageEncoder(appPaths, fileSystem, logManager); AppHost = new MacAppHost(appPaths, logManager, @@ -138,6 +141,18 @@ namespace MediaBrowser.Server.Mac Task.Run (() => StartServer(CancellationToken.None)); } + private static IImageEncoder GetImageEncoder(ServerApplicationPaths appPaths, IFileSystem fileSystem, ILogManager logManager) + { + try + { + return new SkiaEncoder(logManager.GetLogger("Skia"), appPaths, () => AppHost.HttpClient, fileSystem); + } + catch (Exception ex) + { + return new NullImageEncoder(); + } + } + private static void GenerateCertificate(string certPath, string certHost, string certPassword) { CertificateGenerator.CreateSelfSignCertificatePfx(certPath, certHost, certPassword, _logger); From b08f10ec40e727d008161d3e1d36a6f23adef11d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 13 May 2017 00:36:13 -0400 Subject: [PATCH 09/25] update mac project --- MediaBrowser.Server.Mac.sln | 22 ------------------- .../Emby.Server.Mac.csproj | 4 ---- 2 files changed, 26 deletions(-) diff --git a/MediaBrowser.Server.Mac.sln b/MediaBrowser.Server.Mac.sln index 5568b8455d..75cec579a4 100644 --- a/MediaBrowser.Server.Mac.sln +++ b/MediaBrowser.Server.Mac.sln @@ -37,8 +37,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DvdLib", "DvdLib\DvdLib.csp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Dlna", "Emby.Dlna\Emby.Dlna.csproj", "{805844AB-E92F-45E6-9D99-4F6D48D129A5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Drawing.Net", "Emby.Drawing.Net\Emby.Drawing.Net.csproj", "{C97A239E-A96C-4D64-A844-CCF8CC30AECB}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Photos", "Emby.Photos\Emby.Photos.csproj", "{89AB4548-770D-41FD-A891-8DAFF44F452C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Server.Implementations", "Emby.Server.Implementations\Emby.Server.Implementations.csproj", "{E383961B-9356-4D5D-8233-9A1079D03055}" @@ -400,26 +398,6 @@ Global {805844AB-E92F-45E6-9D99-4F6D48D129A5}.Signed|Any CPU.Build.0 = Release|Any CPU {805844AB-E92F-45E6-9D99-4F6D48D129A5}.Signed|x86.ActiveCfg = Release|Any CPU {805844AB-E92F-45E6-9D99-4F6D48D129A5}.Signed|x86.Build.0 = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.AppStore|Any CPU.Build.0 = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.AppStore|x86.ActiveCfg = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.AppStore|x86.Build.0 = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Debug|x86.ActiveCfg = Debug|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Debug|x86.Build.0 = Debug|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Release Mono|Any CPU.ActiveCfg = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Release Mono|Any CPU.Build.0 = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Release Mono|x86.ActiveCfg = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Release Mono|x86.Build.0 = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Release|Any CPU.Build.0 = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Release|x86.ActiveCfg = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Release|x86.Build.0 = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Signed|Any CPU.ActiveCfg = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Signed|Any CPU.Build.0 = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Signed|x86.ActiveCfg = Release|Any CPU - {C97A239E-A96C-4D64-A844-CCF8CC30AECB}.Signed|x86.Build.0 = Release|Any CPU {89AB4548-770D-41FD-A891-8DAFF44F452C}.AppStore|Any CPU.ActiveCfg = Release|Any CPU {89AB4548-770D-41FD-A891-8DAFF44F452C}.AppStore|Any CPU.Build.0 = Release|Any CPU {89AB4548-770D-41FD-A891-8DAFF44F452C}.AppStore|x86.ActiveCfg = Release|Any CPU diff --git a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj index 8a1c96aded..6e43908c0d 100644 --- a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj +++ b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj @@ -224,10 +224,6 @@ {89AB4548-770D-41FD-A891-8DAFF44F452C} Emby.Photos - - {C97A239E-A96C-4D64-A844-CCF8CC30AECB} - Emby.Drawing.Net - {2312da6d-ff86-4597-9777-bceec32d96dd} Emby.Drawing.Skia From 14533d9cc9cccac550fe11676059b2d7d7c5fc51 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 13 May 2017 15:29:13 -0400 Subject: [PATCH 10/25] don't use hwaccel auto --- MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 11311905c2..29d37f99b8 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -1749,7 +1749,8 @@ namespace MediaBrowser.Controller.MediaEncoding { if (!string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType)) { - return "-hwaccel auto"; + // causing unpredictable results + //return "-hwaccel auto"; } if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase)) From 0beb803aed85378fc4b945e1b2c9e34968a7e39f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 13 May 2017 15:31:25 -0400 Subject: [PATCH 11/25] add sample rate condition --- Emby.Dlna/Didl/DidlBuilder.cs | 3 ++- Emby.Server.Implementations/Dto/DtoService.cs | 9 --------- MediaBrowser.Api/ItemUpdateService.cs | 6 ------ MediaBrowser.Api/Playback/BaseStreamingService.cs | 2 +- MediaBrowser.Controller/Entities/IHasAwards.cs | 15 --------------- MediaBrowser.Controller/Entities/Movies/Movie.cs | 4 +--- .../MediaBrowser.Controller.csproj | 1 - .../Parsers/BaseItemXmlParser.cs | 15 --------------- MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs | 7 ------- .../Encoder/EncodingJobFactory.cs | 2 +- MediaBrowser.Model/Dlna/ConditionProcessor.cs | 7 ++++++- MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs | 3 ++- MediaBrowser.Model/Dlna/DeviceProfile.cs | 4 ++-- MediaBrowser.Model/Dlna/ProfileConditionValue.cs | 3 ++- MediaBrowser.Model/Dlna/StreamBuilder.cs | 15 +++++++++------ MediaBrowser.Model/Dto/BaseItemDto.cs | 2 -- MediaBrowser.Model/Querying/ItemFields.cs | 5 ----- MediaBrowser.Providers/Manager/ProviderUtils.cs | 15 --------------- MediaBrowser.Providers/Omdb/OmdbProvider.cs | 6 ------ .../Parsers/BaseNfoParser.cs | 15 --------------- MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs | 7 ------- 21 files changed, 26 insertions(+), 120 deletions(-) delete mode 100644 MediaBrowser.Controller/Entities/IHasAwards.cs diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.cs index c7eae91dd4..c308d9c632 100644 --- a/Emby.Dlna/Didl/DidlBuilder.cs +++ b/Emby.Dlna/Didl/DidlBuilder.cs @@ -488,7 +488,8 @@ namespace Emby.Dlna.Didl var mediaProfile = _profile.GetAudioMediaProfile(streamInfo.Container, streamInfo.TargetAudioCodec, targetChannels, - targetAudioBitrate); + targetAudioBitrate, + targetSampleRate); var filename = url.Substring(0, url.IndexOf('?')); diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 78d76fd761..d784bcb09b 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -883,15 +883,6 @@ namespace Emby.Server.Implementations.Dto dto.AspectRatio = hasAspectRatio.AspectRatio; } - if (fields.Contains(ItemFields.AwardSummary)) - { - var hasAwards = item as IHasAwards; - if (hasAwards != null) - { - dto.AwardSummary = hasAwards.AwardSummary; - } - } - var backdropLimit = options.GetImageLimit(ImageType.Backdrop); if (backdropLimit > 0) { diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index 29530688c0..cdc33dfd49 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -335,12 +335,6 @@ namespace MediaBrowser.Api video.Video3DFormat = request.Video3DFormat; } - var hasAwards = item as IHasAwards; - if (hasAwards != null) - { - hasAwards.AwardSummary = request.AwardSummary; - } - var game = item as Game; if (game != null) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 67921ab348..6edeb960a8 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -866,7 +866,7 @@ namespace MediaBrowser.Api.Playback var videoCodec = state.ActualOutputVideoCodec; var mediaProfile = state.VideoRequest == null ? - profile.GetAudioMediaProfile(state.OutputContainer, audioCodec, state.OutputAudioChannels, state.OutputAudioBitrate) : + profile.GetAudioMediaProfile(state.OutputContainer, audioCodec, state.OutputAudioChannels, state.OutputAudioBitrate, state.OutputAudioSampleRate) : profile.GetVideoMediaProfile(state.OutputContainer, audioCodec, videoCodec, diff --git a/MediaBrowser.Controller/Entities/IHasAwards.cs b/MediaBrowser.Controller/Entities/IHasAwards.cs deleted file mode 100644 index 6661702fa5..0000000000 --- a/MediaBrowser.Controller/Entities/IHasAwards.cs +++ /dev/null @@ -1,15 +0,0 @@ - -namespace MediaBrowser.Controller.Entities -{ - /// - /// Interface IHasAwards - /// - public interface IHasAwards - { - /// - /// Gets or sets the awards summary. - /// - /// The awards summary. - string AwardSummary { get; set; } - } -} diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 371be3dfeb..c2a01f4fff 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -17,7 +17,7 @@ namespace MediaBrowser.Controller.Entities.Movies /// /// Class Movie /// - public class Movie : Video, IHasSpecialFeatures, IHasTrailers, IHasAwards, IHasLookupInfo, ISupportsBoxSetGrouping + public class Movie : Video, IHasSpecialFeatures, IHasTrailers, IHasLookupInfo, ISupportsBoxSetGrouping { public List SpecialFeatureIds { get; set; } @@ -29,8 +29,6 @@ namespace MediaBrowser.Controller.Entities.Movies RemoteTrailerIds = new List(); } - public string AwardSummary { get; set; } - public List LocalTrailerIds { get; set; } public List RemoteTrailerIds { get; set; } diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 1f10fab739..38cff6d674 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -131,7 +131,6 @@ - diff --git a/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs index 2500ee4820..53327deca7 100644 --- a/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs @@ -207,21 +207,6 @@ namespace MediaBrowser.LocalMetadata.Parsers break; } - case "AwardSummary": - { - var text = reader.ReadElementContentAsString(); - var hasAwards = item as IHasAwards; - if (hasAwards != null) - { - if (!string.IsNullOrWhiteSpace(text)) - { - hasAwards.AwardSummary = text; - } - } - - break; - } - case "SortTitle": { var val = reader.ReadElementContentAsString(); diff --git a/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs b/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs index 57e2ec450d..dd93380fa8 100644 --- a/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs +++ b/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs @@ -35,7 +35,6 @@ namespace MediaBrowser.LocalMetadata.Savers "AspectRatio", "AudioDbAlbumId", "AudioDbArtistId", - "AwardSummary", "BirthDate", // Deprecated. No longer saving in this field. @@ -403,12 +402,6 @@ namespace MediaBrowser.LocalMetadata.Savers writer.WriteElementString("DisplayOrder", hasDisplayOrder.DisplayOrder); } - var hasAwards = item as IHasAwards; - if (hasAwards != null && !string.IsNullOrEmpty(hasAwards.AwardSummary)) - { - writer.WriteElementString("AwardSummary", hasAwards.AwardSummary); - } - if (item.CommunityRating.HasValue) { writer.WriteElementString("Rating", item.CommunityRating.Value.ToString(UsCulture)); diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs b/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs index 3e99d68ce3..df067f3c86 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs @@ -263,7 +263,7 @@ namespace MediaBrowser.MediaEncoding.Encoder var outputContainer = state.Options.OutputContainer; var mediaProfile = state.IsVideoRequest ? - profile.GetAudioMediaProfile(outputContainer, audioCodec, state.OutputAudioChannels, state.OutputAudioBitrate) : + profile.GetAudioMediaProfile(outputContainer, audioCodec, state.OutputAudioChannels, state.OutputAudioBitrate, state.OutputAudioSampleRate) : profile.GetVideoMediaProfile(outputContainer, audioCodec, videoCodec, diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs index 1c11e6a3ca..63e962c4e3 100644 --- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs +++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs @@ -76,7 +76,7 @@ namespace MediaBrowser.Model.Dlna } } - public bool IsAudioConditionSatisfied(ProfileCondition condition, int? audioChannels, int? audioBitrate) + public bool IsAudioConditionSatisfied(ProfileCondition condition, int? audioChannels, int? audioBitrate, int? audioSampleRate) { switch (condition.Property) { @@ -84,6 +84,8 @@ namespace MediaBrowser.Model.Dlna return IsConditionSatisfied(condition, audioBitrate); case ProfileConditionValue.AudioChannels: return IsConditionSatisfied(condition, audioChannels); + case ProfileConditionValue.AudioSampleRate: + return IsConditionSatisfied(condition, audioSampleRate); default: throw new ArgumentException("Unexpected condition on audio file: " + condition.Property); } @@ -92,6 +94,7 @@ namespace MediaBrowser.Model.Dlna public bool IsVideoAudioConditionSatisfied(ProfileCondition condition, int? audioChannels, int? audioBitrate, + int? audioSampleRate, string audioProfile, bool? isSecondaryTrack) { @@ -105,6 +108,8 @@ namespace MediaBrowser.Model.Dlna return IsConditionSatisfied(condition, audioChannels); case ProfileConditionValue.IsSecondaryAudio: return IsConditionSatisfied(condition, isSecondaryTrack); + case ProfileConditionValue.AudioSampleRate: + return IsConditionSatisfied(condition, audioSampleRate); default: throw new ArgumentException("Unexpected condition on audio file: " + condition.Property); } diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs index 4a16a27805..cd1a29d6b6 100644 --- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs +++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs @@ -85,7 +85,8 @@ namespace MediaBrowser.Model.Dlna ResponseProfile mediaProfile = _profile.GetAudioMediaProfile(container, audioCodec, audioChannels, - audioBitrate); + audioBitrate, + audioSampleRate); string orgPn = mediaProfile == null ? null : mediaProfile.OrgPn; diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs index d99a21e6d1..cd3c9e92b5 100644 --- a/MediaBrowser.Model/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs @@ -185,7 +185,7 @@ namespace MediaBrowser.Model.Dlna return null; } - public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int? audioChannels, int? audioBitrate) + public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int? audioChannels, int? audioBitrate, int? audioSampleRate) { container = StringHelper.TrimStart(container ?? string.Empty, '.'); @@ -213,7 +213,7 @@ namespace MediaBrowser.Model.Dlna var anyOff = false; foreach (ProfileCondition c in i.Conditions) { - if (!conditionProcessor.IsAudioConditionSatisfied(GetModelProfileCondition(c), audioChannels, audioBitrate)) + if (!conditionProcessor.IsAudioConditionSatisfied(GetModelProfileCondition(c), audioChannels, audioBitrate, audioSampleRate)) { anyOff = true; break; diff --git a/MediaBrowser.Model/Dlna/ProfileConditionValue.cs b/MediaBrowser.Model/Dlna/ProfileConditionValue.cs index dbd574f864..208a7df7e8 100644 --- a/MediaBrowser.Model/Dlna/ProfileConditionValue.cs +++ b/MediaBrowser.Model/Dlna/ProfileConditionValue.cs @@ -22,6 +22,7 @@ IsSecondaryAudio = 18, VideoCodecTag = 19, IsAvc = 20, - IsInterlaced = 21 + IsInterlaced = 21, + AudioSampleRate = 22 } } \ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 1202389675..6ff3ce94c5 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -139,6 +139,7 @@ namespace MediaBrowser.Model.Dlna int? inputAudioChannels = audioStream == null ? null : audioStream.Channels; int? inputAudioBitrate = audioStream == null ? null : audioStream.BitDepth; + int? inputAudioSampleRate = audioStream == null ? null : audioStream.SampleRate; if (directPlayMethods.Count > 0) { @@ -155,7 +156,7 @@ namespace MediaBrowser.Model.Dlna bool applyConditions = true; foreach (ProfileCondition applyCondition in i.ApplyConditions) { - if (!conditionProcessor.IsAudioConditionSatisfied(applyCondition, inputAudioChannels, inputAudioBitrate)) + if (!conditionProcessor.IsAudioConditionSatisfied(applyCondition, inputAudioChannels, inputAudioBitrate, inputAudioSampleRate)) { LogConditionFailure(options.Profile, "AudioCodecProfile", applyCondition, item); applyConditions = false; @@ -176,7 +177,7 @@ namespace MediaBrowser.Model.Dlna bool all = true; foreach (ProfileCondition c in conditions) { - if (!conditionProcessor.IsAudioConditionSatisfied(c, inputAudioChannels, inputAudioBitrate)) + if (!conditionProcessor.IsAudioConditionSatisfied(c, inputAudioChannels, inputAudioBitrate, inputAudioSampleRate)) { LogConditionFailure(options.Profile, "AudioCodecProfile", c, item); all = false; @@ -251,7 +252,7 @@ namespace MediaBrowser.Model.Dlna bool applyConditions = true; foreach (ProfileCondition applyCondition in i.ApplyConditions) { - if (!conditionProcessor.IsAudioConditionSatisfied(applyCondition, inputAudioChannels, inputAudioBitrate)) + if (!conditionProcessor.IsAudioConditionSatisfied(applyCondition, inputAudioChannels, inputAudioBitrate, inputAudioSampleRate)) { LogConditionFailure(options.Profile, "AudioCodecProfile", applyCondition, item); applyConditions = false; @@ -519,8 +520,9 @@ namespace MediaBrowser.Model.Dlna int? inputAudioBitrate = audioStream == null ? null : audioStream.BitRate; int? audioChannels = audioStream == null ? null : audioStream.Channels; string audioProfile = audioStream == null ? null : audioStream.Profile; + int? inputAudioSampleRate = audioStream == null ? null : audioStream.SampleRate; - if (!conditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, inputAudioBitrate, audioProfile, isSecondaryAudio)) + if (!conditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, inputAudioBitrate, inputAudioSampleRate, audioProfile, isSecondaryAudio)) { LogConditionFailure(options.Profile, "AudioCodecProfile", applyCondition, item); applyConditions = false; @@ -752,6 +754,7 @@ namespace MediaBrowser.Model.Dlna int? audioBitrate = audioStream == null ? null : audioStream.BitRate; int? audioChannels = audioStream == null ? null : audioStream.Channels; string audioProfile = audioStream == null ? null : audioStream.Profile; + int? audioSampleRate = audioStream == null ? null : audioStream.SampleRate; TransportStreamTimestamp? timestamp = videoStream == null ? TransportStreamTimestamp.None : mediaSource.Timestamp; int? packetLength = videoStream == null ? null : videoStream.PacketLength; @@ -841,7 +844,7 @@ namespace MediaBrowser.Model.Dlna bool applyConditions = true; foreach (ProfileCondition applyCondition in i.ApplyConditions) { - if (!conditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, audioBitrate, audioProfile, isSecondaryAudio)) + if (!conditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, audioBitrate, audioSampleRate, audioProfile, isSecondaryAudio)) { LogConditionFailure(profile, "VideoAudioCodecProfile", applyCondition, mediaSource); applyConditions = false; @@ -861,7 +864,7 @@ namespace MediaBrowser.Model.Dlna foreach (ProfileCondition i in conditions) { - if (!conditionProcessor.IsVideoAudioConditionSatisfied(i, audioChannels, audioBitrate, audioProfile, isSecondaryAudio)) + if (!conditionProcessor.IsVideoAudioConditionSatisfied(i, audioChannels, audioBitrate, audioSampleRate, audioProfile, isSecondaryAudio)) { LogConditionFailure(profile, "VideoAudioCodecProfile", i, mediaSource); diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 1a752892ee..9384446eb2 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -79,8 +79,6 @@ namespace MediaBrowser.Model.Dto public string PreferredMetadataLanguage { get; set; } public string PreferredMetadataCountryCode { get; set; } - public string AwardSummary { get; set; } - /// /// Gets or sets a value indicating whether [supports synchronize]. /// diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.cs index 75ba09b609..ab560875ec 100644 --- a/MediaBrowser.Model/Querying/ItemFields.cs +++ b/MediaBrowser.Model/Querying/ItemFields.cs @@ -15,11 +15,6 @@ /// AlternateEpisodeNumbers, - /// - /// The awards summary - /// - AwardSummary, - /// /// The can delete /// diff --git a/MediaBrowser.Providers/Manager/ProviderUtils.cs b/MediaBrowser.Providers/Manager/ProviderUtils.cs index d5494c21fd..1e107d0be1 100644 --- a/MediaBrowser.Providers/Manager/ProviderUtils.cs +++ b/MediaBrowser.Providers/Manager/ProviderUtils.cs @@ -198,7 +198,6 @@ namespace MediaBrowser.Providers.Manager MergeAlbumArtist(source, target, lockedFields, replaceData); MergeCriticRating(source, target, lockedFields, replaceData); - MergeAwards(source, target, lockedFields, replaceData); MergeTrailers(source, target, lockedFields, replaceData); MergeVideoInfo(source, target, lockedFields, replaceData); @@ -273,20 +272,6 @@ namespace MediaBrowser.Providers.Manager } } - private static void MergeAwards(BaseItem source, BaseItem target, List lockedFields, bool replaceData) - { - var sourceCast = source as IHasAwards; - var targetCast = target as IHasAwards; - - if (sourceCast != null && targetCast != null) - { - if (replaceData || string.IsNullOrEmpty(targetCast.AwardSummary)) - { - targetCast.AwardSummary = sourceCast.AwardSummary; - } - } - } - private static void MergeCriticRating(BaseItem source, BaseItem target, List lockedFields, bool replaceData) { if (replaceData || !target.CriticRating.HasValue) diff --git a/MediaBrowser.Providers/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Omdb/OmdbProvider.cs index b89105376a..dd3ba23db1 100644 --- a/MediaBrowser.Providers/Omdb/OmdbProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbProvider.cs @@ -406,12 +406,6 @@ namespace MediaBrowser.Providers.Omdb } } - var hasAwards = item as IHasAwards; - if (hasAwards != null && !string.IsNullOrEmpty(result.Awards)) - { - hasAwards.AwardSummary = WebUtility.HtmlDecode(result.Awards); - } - if (isConfiguredForEnglish) { // Omdb is currently english only, so for other languages skip this and let secondary providers fill it in diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs index d8f7cb57f4..c9ec195d9c 100644 --- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs +++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs @@ -341,21 +341,6 @@ namespace MediaBrowser.XbmcMetadata.Parsers break; } - case "awardsummary": - { - var text = reader.ReadElementContentAsString(); - var hasAwards = item as IHasAwards; - if (hasAwards != null) - { - if (!string.IsNullOrWhiteSpace(text)) - { - hasAwards.AwardSummary = text; - } - } - - break; - } - case "sorttitle": { var val = reader.ReadElementContentAsString(); diff --git a/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs index ae24928028..8658f512bf 100644 --- a/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs +++ b/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs @@ -81,7 +81,6 @@ namespace MediaBrowser.XbmcMetadata.Savers "country", "audiodbalbumid", "audiodbartistid", - "awardsummary", "enddate", "lockedfields", "zap2itid", @@ -711,12 +710,6 @@ namespace MediaBrowser.XbmcMetadata.Savers writer.WriteElementString("plotkeyword", tag); } - var hasAwards = item as IHasAwards; - if (hasAwards != null && !string.IsNullOrEmpty(hasAwards.AwardSummary)) - { - writer.WriteElementString("awardsummary", hasAwards.AwardSummary); - } - var externalId = item.GetProviderId(MetadataProviders.AudioDbArtist); if (!string.IsNullOrEmpty(externalId)) From 8e7b6f6bcabdec041c68dbf2311dc9c210fdef0d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 13 May 2017 15:32:10 -0400 Subject: [PATCH 12/25] update db CacheSize --- .../Data/BaseSqliteRepository.cs | 8 +-- .../Data/SqliteItemRepository.cs | 69 ++++++++++--------- 2 files changed, 37 insertions(+), 40 deletions(-) diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs index 64a0d889eb..462ff3e47a 100644 --- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs +++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs @@ -124,7 +124,7 @@ namespace Emby.Server.Implementations.Data if (CacheSize.HasValue) { - queries.Add("PRAGMA cache_size=-" + CacheSize.Value.ToString(CultureInfo.InvariantCulture)); + queries.Add("PRAGMA cache_size=" + CacheSize.Value.ToString(CultureInfo.InvariantCulture)); } if (EnableTempStoreMemory) @@ -132,12 +132,6 @@ namespace Emby.Server.Implementations.Data queries.Add("PRAGMA temp_store = memory"); } - //var cacheSize = CacheSize; - //if (cacheSize.HasValue) - //{ - - //} - ////foreach (var query in queries) ////{ //// db.Execute(query); diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 28be49dc2f..d5842d864a 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -142,7 +142,7 @@ namespace Emby.Server.Implementations.Data = "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))"; string[] queries = { - "PRAGMA locking_mode=NORMAL", + "PRAGMA locking_mode=EXCLUSIVE", "create table if not exists TypedBaseItems (guid GUID primary key NOT NULL, type TEXT NOT NULL, data BLOB NULL, ParentId GUID NULL, Path TEXT NULL)", @@ -1258,22 +1258,6 @@ namespace Emby.Server.Implementations.Data { if (_config.Configuration.SkipDeserializationForBasicTypes) { - if (type == typeof(MusicGenre)) - { - return false; - } - if (type == typeof(GameGenre)) - { - return false; - } - if (type == typeof(Genre)) - { - return false; - } - if (type == typeof(Studio)) - { - return false; - } if (type == typeof(Person)) { return false; @@ -1282,26 +1266,10 @@ namespace Emby.Server.Implementations.Data { return false; } - if (type == typeof(ManualCollectionsFolder)) - { - return false; - } - if (type == typeof(CameraUploadsFolder)) - { - return false; - } - if (type == typeof(PlaylistsFolder)) - { - return false; - } if (type == typeof(UserRootFolder)) { return false; } - if (type == typeof(PhotoAlbum)) - { - return false; - } if (type == typeof(Season)) { return false; @@ -1312,6 +1280,41 @@ namespace Emby.Server.Implementations.Data } } + if (type == typeof(MusicGenre)) + { + return false; + } + if (type == typeof(GameGenre)) + { + return false; + } + if (type == typeof(Genre)) + { + return false; + } + if (type == typeof(Studio)) + { + return false; + } + + if (type == typeof(ManualCollectionsFolder)) + { + return false; + } + if (type == typeof(CameraUploadsFolder)) + { + return false; + } + if (type == typeof(PlaylistsFolder)) + { + return false; + } + + if (type == typeof(PhotoAlbum)) + { + return false; + } + if (type == typeof(Year)) { return false; From 1867fe2e51975fad4afb84c977accf2d08e6e0c9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 13 May 2017 17:30:07 -0400 Subject: [PATCH 13/25] 3.2.16.2 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 4c7f11ce28..cf3eee5469 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.16.1")] +[assembly: AssemblyVersion("3.2.16.2")] From 992ad9c2d93e6d2ec33af670929db6e4d2cb3bcf Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:54:44 -0400 Subject: [PATCH 14/25] fix plugin uninstall --- Emby.Server.Implementations/Updates/InstallationManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index e7aa402f25..eed17fb66d 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -668,7 +668,7 @@ namespace Emby.Server.Implementations.Updates _logger.Info("Deleting plugin file {0}", path); // Make this case-insensitive to account for possible incorrect assembly naming - var file = _fileSystem.GetFilePaths(path) + var file = _fileSystem.GetFilePaths(_fileSystem.GetDirectoryName(path)) .FirstOrDefault(i => string.Equals(i, path, StringComparison.OrdinalIgnoreCase)); if (!string.IsNullOrWhiteSpace(file)) From 00507972be8a1ab4faefe6fbed110cde3516d0ae Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:55:05 -0400 Subject: [PATCH 15/25] dispose stream in PhotoProvider --- Emby.Photos/PhotoProvider.cs | 157 ++++++++++++++++++----------------- 1 file changed, 80 insertions(+), 77 deletions(-) diff --git a/Emby.Photos/PhotoProvider.cs b/Emby.Photos/PhotoProvider.cs index 006f29c2fa..57047cf81e 100644 --- a/Emby.Photos/PhotoProvider.cs +++ b/Emby.Photos/PhotoProvider.cs @@ -35,110 +35,113 @@ namespace Emby.Photos try { - using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(item.Path), _fileSystem.OpenRead(item.Path), null))) + using (var fileStream = _fileSystem.OpenRead(item.Path)) { - var image = file as TagLib.Image.File; - - var tag = file.GetTag(TagTypes.TiffIFD) as IFDTag; - - if (tag != null) + using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(item.Path), fileStream, null))) { - var structure = tag.Structure; + var image = file as TagLib.Image.File; + + var tag = file.GetTag(TagTypes.TiffIFD) as IFDTag; - if (structure != null) + if (tag != null) { - var exif = structure.GetEntry(0, (ushort)IFDEntryTag.ExifIFD) as SubIFDEntry; + var structure = tag.Structure; - if (exif != null) + if (structure != null) { - var exifStructure = exif.Structure; + var exif = structure.GetEntry(0, (ushort)IFDEntryTag.ExifIFD) as SubIFDEntry; - if (exifStructure != null) + if (exif != null) { - var entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ApertureValue) as RationalIFDEntry; - - if (entry != null) - { - double val = entry.Value.Numerator; - val /= entry.Value.Denominator; - item.Aperture = val; - } - - entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ShutterSpeedValue) as RationalIFDEntry; + var exifStructure = exif.Structure; - if (entry != null) + if (exifStructure != null) { - double val = entry.Value.Numerator; - val /= entry.Value.Denominator; - item.ShutterSpeed = val; + var entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ApertureValue) as RationalIFDEntry; + + if (entry != null) + { + double val = entry.Value.Numerator; + val /= entry.Value.Denominator; + item.Aperture = val; + } + + entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ShutterSpeedValue) as RationalIFDEntry; + + if (entry != null) + { + double val = entry.Value.Numerator; + val /= entry.Value.Denominator; + item.ShutterSpeed = val; + } } } } } - } - item.CameraMake = image.ImageTag.Make; - item.CameraModel = image.ImageTag.Model; + item.CameraMake = image.ImageTag.Make; + item.CameraModel = image.ImageTag.Model; - item.Width = image.Properties.PhotoWidth; - item.Height = image.Properties.PhotoHeight; + item.Width = image.Properties.PhotoWidth; + item.Height = image.Properties.PhotoHeight; - var rating = image.ImageTag.Rating; - if (rating.HasValue) - { - item.CommunityRating = rating; - } - else - { - item.CommunityRating = null; - } + var rating = image.ImageTag.Rating; + if (rating.HasValue) + { + item.CommunityRating = rating; + } + else + { + item.CommunityRating = null; + } - item.Overview = image.ImageTag.Comment; + item.Overview = image.ImageTag.Comment; - if (!string.IsNullOrWhiteSpace(image.ImageTag.Title)) - { - item.Name = image.ImageTag.Title; - } + if (!string.IsNullOrWhiteSpace(image.ImageTag.Title)) + { + item.Name = image.ImageTag.Title; + } - var dateTaken = image.ImageTag.DateTime; - if (dateTaken.HasValue) - { - item.DateCreated = dateTaken.Value; - item.PremiereDate = dateTaken.Value; - item.ProductionYear = dateTaken.Value.Year; - } + var dateTaken = image.ImageTag.DateTime; + if (dateTaken.HasValue) + { + item.DateCreated = dateTaken.Value; + item.PremiereDate = dateTaken.Value; + item.ProductionYear = dateTaken.Value.Year; + } - item.Genres = image.ImageTag.Genres.ToList(); - item.Tags = image.ImageTag.Keywords.ToList(); - item.Software = image.ImageTag.Software; + item.Genres = image.ImageTag.Genres.ToList(); + item.Tags = image.ImageTag.Keywords.ToList(); + item.Software = image.ImageTag.Software; - if (image.ImageTag.Orientation == TagLib.Image.ImageOrientation.None) - { - item.Orientation = null; - } - else - { - MediaBrowser.Model.Drawing.ImageOrientation orientation; - if (Enum.TryParse(image.ImageTag.Orientation.ToString(), true, out orientation)) + if (image.ImageTag.Orientation == TagLib.Image.ImageOrientation.None) { - item.Orientation = orientation; + item.Orientation = null; + } + else + { + MediaBrowser.Model.Drawing.ImageOrientation orientation; + if (Enum.TryParse(image.ImageTag.Orientation.ToString(), true, out orientation)) + { + item.Orientation = orientation; + } } - } - item.ExposureTime = image.ImageTag.ExposureTime; - item.FocalLength = image.ImageTag.FocalLength; + item.ExposureTime = image.ImageTag.ExposureTime; + item.FocalLength = image.ImageTag.FocalLength; - item.Latitude = image.ImageTag.Latitude; - item.Longitude = image.ImageTag.Longitude; - item.Altitude = image.ImageTag.Altitude; + item.Latitude = image.ImageTag.Latitude; + item.Longitude = image.ImageTag.Longitude; + item.Altitude = image.ImageTag.Altitude; - if (image.ImageTag.ISOSpeedRatings.HasValue) - { - item.IsoSpeedRating = Convert.ToInt32(image.ImageTag.ISOSpeedRatings.Value); - } - else - { - item.IsoSpeedRating = null; + if (image.ImageTag.ISOSpeedRatings.HasValue) + { + item.IsoSpeedRating = Convert.ToInt32(image.ImageTag.ISOSpeedRatings.Value); + } + else + { + item.IsoSpeedRating = null; + } } } } From 4acaeecca4227380f2a1432ac682543223ec9b9e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:55:40 -0400 Subject: [PATCH 16/25] update GetImageSize --- Emby.Drawing/ImageProcessor.cs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 82181238bb..ad6ca7d70b 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -513,20 +513,25 @@ namespace Emby.Drawing /// ImageSize. private ImageSize GetImageSizeInternal(string path, bool allowSlowMethod) { - // Can't use taglib because it keeps a lock on the file //try //{ - // using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(path), _fileSystem.OpenRead(path), null))) + // using (var fileStream = _fileSystem.OpenRead(path)) // { - // var image = file as TagLib.Image.File; - - // var properties = image.Properties; - - // return new ImageSize + // using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(path), fileStream, null))) // { - // Height = properties.PhotoHeight, - // Width = properties.PhotoWidth - // }; + // var image = file as TagLib.Image.File; + + // if (image != null) + // { + // var properties = image.Properties; + + // return new ImageSize + // { + // Height = properties.PhotoHeight, + // Width = properties.PhotoWidth + // }; + // } + // } // } //} //catch From bcf28f3e9ca8fd136c2a278efc9ed6c1fd873a9c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:56:06 -0400 Subject: [PATCH 17/25] update file options --- MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index fcf57cebe2..7e4e90924d 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -234,11 +234,11 @@ namespace MediaBrowser.Api.Playback.Hls try { - return FileSystem.GetFileStream(tmpPath, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, true); + return FileSystem.GetFileStream(tmpPath, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, FileOpenOptions.Asynchronous | FileOpenOptions.SequentialScan); } catch (IOException) { - return FileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, true); + return FileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, FileOpenOptions.Asynchronous | FileOpenOptions.SequentialScan); } } From cd4d170267a2489eb9ed736e786b71d6d1347772 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:56:29 -0400 Subject: [PATCH 18/25] add property --- MediaBrowser.Model/Dto/MediaSourceInfo.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs index d0655d90bc..c93eca0e79 100644 --- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs +++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs @@ -31,6 +31,7 @@ namespace MediaBrowser.Model.Dto public bool ReadAtNativeFramerate { get; set; } public bool IgnoreDts { get; set; } public bool IgnoreIndex { get; set; } + public bool GenPtsInput { get; set; } public bool SupportsTranscoding { get; set; } public bool SupportsDirectStream { get; set; } public bool SupportsDirectPlay { get; set; } From f2284af82ab56cfbef7679a1ae6ecb8ebcb4ea89 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 15:17:35 -0400 Subject: [PATCH 19/25] update GenPtsInput --- MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index 409dec482c..f25b4ba3d2 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -59,7 +59,7 @@ namespace MediaBrowser.Controller.MediaEncoding { get { - return false; + return MediaSource.GenPtsInput; } } From 6a628e8d2e711b7f7dccc20629fdac37de41a5a8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 15:20:31 -0400 Subject: [PATCH 20/25] update vsync --- .../MediaEncoding/EncodingJobInfo.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index f25b4ba3d2..9b89e8f5aa 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -93,11 +93,13 @@ namespace MediaBrowser.Controller.MediaEncoding { get { - // For live tv + recordings - if (string.Equals(InputContainer, "mpegts", StringComparison.OrdinalIgnoreCase) || - string.Equals(InputContainer, "ts", StringComparison.OrdinalIgnoreCase)) + // For live tv + in progress recordings + if (string.Equals(InputContainer, "mpegts", StringComparison.OrdinalIgnoreCase) || string.Equals(InputContainer, "ts", StringComparison.OrdinalIgnoreCase)) { - return "cfr"; + if (!MediaSource.RunTimeTicks.HasValue) + { + return "cfr"; + } } return "-1"; From bdc546ed85dfb8389184234ac74c6cc7b4046515 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 15:30:49 -0400 Subject: [PATCH 21/25] 3.2.16.3 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index cf3eee5469..45d6445ff8 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.16.2")] +[assembly: AssemblyVersion("3.2.16.3")] From 2f4f8c105e57c11c48a6c840e6f3cbb11538d82d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 22:27:58 -0400 Subject: [PATCH 22/25] update image processing --- .../ImageMagickEncoder.cs | 26 ++++++- Emby.Drawing.Net/GDIImageEncoder.cs | 20 +++--- Emby.Drawing.Skia/SkiaEncoder.cs | 12 +++- Emby.Drawing/ImageProcessor.cs | 67 +----------------- Emby.Drawing/NullImageEncoder.cs | 2 +- .../Drawing/IImageEncoder.cs | 11 +-- .../Drawing/ImageHelper.cs | 69 +++++++++++++++++++ .../MediaBrowser.Controller.csproj | 1 + MediaBrowser.ServerApplication/MainStartup.cs | 4 -- 9 files changed, 121 insertions(+), 91 deletions(-) create mode 100644 MediaBrowser.Controller/Drawing/ImageHelper.cs diff --git a/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs b/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs index f603c49509..13bde3ca5d 100644 --- a/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs +++ b/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs @@ -130,7 +130,7 @@ namespace Emby.Drawing.ImageMagick string.Equals(ext, ".webp", StringComparison.OrdinalIgnoreCase); } - public void EncodeImage(string inputPath, string outputPath, bool autoOrient, int width, int height, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat) + public void EncodeImage(string inputPath, ImageSize? originalImageSize, string outputPath, bool autoOrient, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat) { // Even if the caller specified 100, don't use it because it takes forever quality = Math.Min(quality, 99); @@ -144,6 +144,16 @@ namespace Emby.Drawing.ImageMagick originalImage.CurrentImage.TrimImage(10); } + if (options.CropWhiteSpace || !originalImageSize.HasValue) + { + originalImageSize = new ImageSize(originalImage.CurrentImage.Width, originalImage.CurrentImage.Height); + } + + var newImageSize = ImageHelper.GetNewImageSize(options, originalImageSize); + + var width = Convert.ToInt32(Math.Round(newImageSize.Width)); + var height = Convert.ToInt32(Math.Round(newImageSize.Height)); + ScaleImage(originalImage, width, height, options.Blur ?? 0); if (autoOrient) @@ -162,9 +172,19 @@ namespace Emby.Drawing.ImageMagick } else { - using (var wand = new MagickWand(width, height, options.BackgroundColor)) + using (var originalImage = new MagickWand(inputPath)) { - using (var originalImage = new MagickWand(inputPath)) + if (options.CropWhiteSpace || !originalImageSize.HasValue) + { + originalImageSize = new ImageSize(originalImage.CurrentImage.Width, originalImage.CurrentImage.Height); + } + + var newImageSize = ImageHelper.GetNewImageSize(options, originalImageSize); + + var width = Convert.ToInt32(Math.Round(newImageSize.Width)); + var height = Convert.ToInt32(Math.Round(newImageSize.Height)); + + using (var wand = new MagickWand(width, height, options.BackgroundColor)) { ScaleImage(originalImage, width, height, options.Blur ?? 0); diff --git a/Emby.Drawing.Net/GDIImageEncoder.cs b/Emby.Drawing.Net/GDIImageEncoder.cs index e710baaa77..02e7657ddf 100644 --- a/Emby.Drawing.Net/GDIImageEncoder.cs +++ b/Emby.Drawing.Net/GDIImageEncoder.cs @@ -11,6 +11,7 @@ using MediaBrowser.Common.IO; using MediaBrowser.Controller.IO; using MediaBrowser.Model.IO; using ImageFormat = MediaBrowser.Model.Drawing.ImageFormat; +using Emby.Drawing; namespace Emby.Drawing.Net { @@ -88,14 +89,19 @@ namespace Emby.Drawing.Net return Image.FromFile(path); } - public void EncodeImage(string inputPath, string cacheFilePath, bool autoOrient, int width, int height, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat) + public void EncodeImage(string inputPath, ImageSize? originalImageSize, string outputPath, bool autoOrient, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat) { - var hasPostProcessing = !string.IsNullOrEmpty(options.BackgroundColor) || options.UnplayedCount.HasValue || options.AddPlayedIndicator || options.PercentPlayed > 0; - using (var originalImage = GetImage(inputPath, options.CropWhiteSpace)) { - var newWidth = Convert.ToInt32(width); - var newHeight = Convert.ToInt32(height); + if (options.CropWhiteSpace || !originalImageSize.HasValue) + { + originalImageSize = new ImageSize(originalImage.Width, originalImage.Height); + } + + var newImageSize = ImageHelper.GetNewImageSize(options, originalImageSize); + + var newWidth = Convert.ToInt32(Math.Round(newImageSize.Width)); + var newHeight = Convert.ToInt32(Math.Round(newImageSize.Height)); // Graphics.FromImage will throw an exception if the PixelFormat is Indexed, so we need to handle that here // Also, Webp only supports Format32bppArgb and Format32bppRgb @@ -132,10 +138,8 @@ namespace Emby.Drawing.Net var outputFormat = GetOutputFormat(originalImage, selectedOutputFormat); - _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFilePath)); - // Save to the cache location - using (var cacheFileStream = _fileSystem.GetFileStream(cacheFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, false)) + using (var cacheFileStream = _fileSystem.GetFileStream(outputPath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, false)) { // Save to the memory stream thumbnail.Save(outputFormat, cacheFileStream, quality); diff --git a/Emby.Drawing.Skia/SkiaEncoder.cs b/Emby.Drawing.Skia/SkiaEncoder.cs index 74ceb75910..018de5bc96 100644 --- a/Emby.Drawing.Skia/SkiaEncoder.cs +++ b/Emby.Drawing.Skia/SkiaEncoder.cs @@ -226,7 +226,7 @@ namespace Emby.Drawing.Skia return Decode(path); } - public void EncodeImage(string inputPath, string outputPath, bool autoOrient, int width, int height, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat) + public void EncodeImage(string inputPath, ImageSize? originalImageSize, string outputPath, bool autoOrient, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat) { if (string.IsNullOrWhiteSpace(inputPath)) { @@ -246,6 +246,16 @@ namespace Emby.Drawing.Skia using (var bitmap = GetBitmap(inputPath, options.CropWhiteSpace)) { + if (options.CropWhiteSpace || !originalImageSize.HasValue) + { + originalImageSize = new ImageSize(bitmap.Width, bitmap.Height); + } + + var newImageSize = ImageHelper.GetNewImageSize(options, originalImageSize); + + var width = Convert.ToInt32(Math.Round(newImageSize.Width)); + var height = Convert.ToInt32(Math.Round(newImageSize.Height)); + using (var resizedBitmap = new SKBitmap(width, height))//, bitmap.ColorType, bitmap.AlphaType)) { // scale image diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index ad6ca7d70b..3fa6f64503 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -227,7 +227,7 @@ namespace Emby.Drawing originalImageSize = null; } - var newSize = GetNewImageSize(options, originalImageSize); + var newSize = ImageHelper.GetNewImageSize(options, originalImageSize); var quality = options.Quality; var outputFormat = GetOutputFormat(options.SupportedOutputFormats[0]); @@ -239,14 +239,11 @@ namespace Emby.Drawing if (!_fileSystem.FileExists(cacheFilePath)) { - var newWidth = Convert.ToInt32(Math.Round(newSize.Width)); - var newHeight = Convert.ToInt32(Math.Round(newSize.Height)); - _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFilePath)); var tmpPath = Path.ChangeExtension(Path.Combine(_appPaths.TempDirectory, Guid.NewGuid().ToString("N")), Path.GetExtension(cacheFilePath)); _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(tmpPath)); - _imageEncoder.EncodeImage(originalImagePath, tmpPath, AutoOrient(options.Item), newWidth, newHeight, quality, options, outputFormat); + _imageEncoder.EncodeImage(originalImagePath, originalImageSize, tmpPath, AutoOrient(options.Item), quality, options, outputFormat); CopyFile(tmpPath, cacheFilePath); return new Tuple(tmpPath, GetMimeType(outputFormat, cacheFilePath), _fileSystem.GetLastWriteTimeUtc(tmpPath)); @@ -328,66 +325,6 @@ namespace Emby.Drawing return MimeTypes.GetMimeType(path); } - private ImageSize GetNewImageSize(ImageProcessingOptions options, ImageSize? originalImageSize) - { - if (originalImageSize.HasValue) - { - // Determine the output size based on incoming parameters - var newSize = DrawingUtils.Resize(originalImageSize.Value, options.Width, options.Height, options.MaxWidth, options.MaxHeight); - - return newSize; - } - return GetSizeEstimate(options); - } - - private ImageSize GetSizeEstimate(ImageProcessingOptions options) - { - if (options.Width.HasValue && options.Height.HasValue) - { - return new ImageSize(options.Width.Value, options.Height.Value); - } - - var aspect = GetEstimatedAspectRatio(options.Image.Type, options.Item); - - var width = options.Width ?? options.MaxWidth; - - if (width.HasValue) - { - var heightValue = width.Value / aspect; - return new ImageSize(width.Value, heightValue); - } - - var height = options.Height ?? options.MaxHeight ?? 200; - var widthValue = aspect * height; - return new ImageSize(widthValue, height); - } - - private double GetEstimatedAspectRatio(ImageType type, IHasImages item) - { - switch (type) - { - case ImageType.Art: - case ImageType.Backdrop: - case ImageType.Chapter: - case ImageType.Screenshot: - case ImageType.Thumb: - return 1.78; - case ImageType.Banner: - return 5.4; - case ImageType.Box: - case ImageType.BoxRear: - case ImageType.Disc: - case ImageType.Menu: - return 1; - case ImageType.Logo: - return 2.58; - case ImageType.Primary: - return item.GetDefaultPrimaryImageAspectRatio() ?? .667; - default: - return 1; - } - } - private ImageFormat GetOutputFormat(ImageFormat requestedFormat) { if (requestedFormat == ImageFormat.Webp && !_imageEncoder.SupportedOutputFormats.Contains(ImageFormat.Webp)) diff --git a/Emby.Drawing/NullImageEncoder.cs b/Emby.Drawing/NullImageEncoder.cs index c7d365fb2c..1723e0637b 100644 --- a/Emby.Drawing/NullImageEncoder.cs +++ b/Emby.Drawing/NullImageEncoder.cs @@ -32,7 +32,7 @@ namespace Emby.Drawing throw new NotImplementedException(); } - public void EncodeImage(string inputPath, string outputPath, bool autoOrient, int width, int height, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat) + public void EncodeImage(string inputPath, ImageSize? originalImageSize, string outputPath, bool autoOrient, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat) { throw new NotImplementedException(); } diff --git a/MediaBrowser.Controller/Drawing/IImageEncoder.cs b/MediaBrowser.Controller/Drawing/IImageEncoder.cs index 830093fcf2..64d997dba0 100644 --- a/MediaBrowser.Controller/Drawing/IImageEncoder.cs +++ b/MediaBrowser.Controller/Drawing/IImageEncoder.cs @@ -15,18 +15,11 @@ namespace MediaBrowser.Controller.Drawing /// /// The supported output formats. ImageFormat[] SupportedOutputFormats { get; } + /// /// Encodes the image. /// - /// The input path. - /// The output path. - /// if set to true [automatic orient]. - /// The width. - /// The height. - /// The quality. - /// The options. - /// The output format. - void EncodeImage(string inputPath, string outputPath, bool autoOrient, int width, int height, int quality, ImageProcessingOptions options, ImageFormat outputFormat); + void EncodeImage(string inputPath, ImageSize? originalImageSize, string outputPath, bool autoOrient, int quality, ImageProcessingOptions options, ImageFormat outputFormat); /// /// Creates the image collage. diff --git a/MediaBrowser.Controller/Drawing/ImageHelper.cs b/MediaBrowser.Controller/Drawing/ImageHelper.cs new file mode 100644 index 0000000000..30c4e90fb0 --- /dev/null +++ b/MediaBrowser.Controller/Drawing/ImageHelper.cs @@ -0,0 +1,69 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Drawing; +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Controller.Drawing +{ + public static class ImageHelper + { + public static ImageSize GetNewImageSize(ImageProcessingOptions options, ImageSize? originalImageSize) + { + if (originalImageSize.HasValue) + { + // Determine the output size based on incoming parameters + var newSize = DrawingUtils.Resize(originalImageSize.Value, options.Width, options.Height, options.MaxWidth, options.MaxHeight); + + return newSize; + } + return GetSizeEstimate(options); + } + + private static ImageSize GetSizeEstimate(ImageProcessingOptions options) + { + if (options.Width.HasValue && options.Height.HasValue) + { + return new ImageSize(options.Width.Value, options.Height.Value); + } + + var aspect = GetEstimatedAspectRatio(options.Image.Type, options.Item); + + var width = options.Width ?? options.MaxWidth; + + if (width.HasValue) + { + var heightValue = width.Value / aspect; + return new ImageSize(width.Value, heightValue); + } + + var height = options.Height ?? options.MaxHeight ?? 200; + var widthValue = aspect * height; + return new ImageSize(widthValue, height); + } + + private static double GetEstimatedAspectRatio(ImageType type, IHasImages item) + { + switch (type) + { + case ImageType.Art: + case ImageType.Backdrop: + case ImageType.Chapter: + case ImageType.Screenshot: + case ImageType.Thumb: + return 1.78; + case ImageType.Banner: + return 5.4; + case ImageType.Box: + case ImageType.BoxRear: + case ImageType.Disc: + case ImageType.Menu: + return 1; + case ImageType.Logo: + return 2.58; + case ImageType.Primary: + return item.GetDefaultPrimaryImageAspectRatio() ?? .667; + default: + return 1; + } + } + } +} diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 38cff6d674..b3a29bafad 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -91,6 +91,7 @@ + diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index 272054609f..37c71545a4 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -775,8 +775,6 @@ namespace MediaBrowser.ServerApplication return; } - MessageBox.Show("The Visual C++ 2013 Runtime will now be installed.", "Install Visual C++ Runtime", MessageBoxButtons.OK, MessageBoxIcon.Information); - try { await InstallVcredist(GetVcredist2013Url()).ConfigureAwait(false); @@ -829,8 +827,6 @@ namespace MediaBrowser.ServerApplication return; } - MessageBox.Show("The Visual C++ 2015 Runtime will now be installed.", "Install Visual C++ Runtime", MessageBoxButtons.OK, MessageBoxIcon.Information); - try { await InstallVcredist(GetVcredist2015Url()).ConfigureAwait(false); From 5e994eabd5e30aacd3f9a90f548b167fe0e8f69b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 22:28:32 -0400 Subject: [PATCH 23/25] update other parental control option --- MediaBrowser.Controller/Entities/InternalItemsQuery.cs | 2 +- MediaBrowser.Controller/Entities/PhotoAlbum.cs | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs index 092461c842..3c948487d8 100644 --- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs +++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs @@ -251,7 +251,7 @@ namespace MediaBrowser.Controller.Entities if (policy.MaxParentalRating.HasValue) { - BlockUnratedItems = policy.BlockUnratedItems; + BlockUnratedItems = policy.BlockUnratedItems.Where(i => i != UnratedItem.Other).ToArray(); } ExcludeInheritedTags = policy.BlockedTags; diff --git a/MediaBrowser.Controller/Entities/PhotoAlbum.cs b/MediaBrowser.Controller/Entities/PhotoAlbum.cs index c902ac8cda..dd3cd98fb9 100644 --- a/MediaBrowser.Controller/Entities/PhotoAlbum.cs +++ b/MediaBrowser.Controller/Entities/PhotoAlbum.cs @@ -1,7 +1,4 @@ -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Users; -using System.Linq; -using MediaBrowser.Model.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { @@ -24,10 +21,5 @@ namespace MediaBrowser.Controller.Entities return false; } } - - protected override bool GetBlockUnratedValue(UserPolicy config) - { - return config.BlockUnratedItems.Contains(UnratedItem.Other); - } } } From bc865ce6987cd263c865d9eff8e789c88d435f7a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 15 May 2017 00:27:08 -0400 Subject: [PATCH 24/25] update series sorting --- Emby.Server.Implementations/Data/SqliteItemRepository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index d5842d864a..e07425c865 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -2854,7 +2854,7 @@ namespace Emby.Server.Implementations.Data } if (string.Equals(name, ItemSortBy.SeriesSortName, StringComparison.OrdinalIgnoreCase)) { - return new Tuple("(Select SortName from TypedBaseItems where B.Guid=A.SeriesId)", false); + return new Tuple("SeriesName", false); } return new Tuple(name, false); From cd0994de2b35c97deffb3d68efe3c7d4585e9e4b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 15 May 2017 00:32:27 -0400 Subject: [PATCH 25/25] update mac project --- MediaBrowser.Server.Mac/Emby.Server.Mac.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj index 6e43908c0d..b53d1027f6 100644 --- a/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj +++ b/MediaBrowser.Server.Mac/Emby.Server.Mac.csproj @@ -2224,6 +2224,9 @@ Resources\dashboard-ui\scripts\encodingsettings.js + + Resources\dashboard-ui\scripts\episodes.js + Resources\dashboard-ui\scripts\forgotpassword.js