From 39394e74c70f0b8fa9bd4415f6213edbd5ba04fd Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 23 Sep 2017 21:03:46 -0400 Subject: [PATCH 1/2] fix dlna direct play on samsung tv's --- .../ApplicationHost.cs | 39 +++++++++++++------ .../HttpServer/HttpResultFactory.cs | 2 +- .../Configuration/EncodingOptions.cs | 3 +- MediaBrowser.Server.Mono/MonoAppHost.cs | 2 +- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index ba43c7f350..894d91f71b 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -2211,19 +2211,36 @@ namespace Emby.Server.Implementations TimeSpan.FromHours(12) : TimeSpan.FromMinutes(5); - var result = await new GithubUpdater(HttpClient, JsonSerializer).CheckForUpdateResult("MediaBrowser", - "Emby", - ApplicationVersion, - updateLevel, - ReleaseAssetFilename, - "MBServer", - UpdateTargetFileName, - cacheLength, - cancellationToken).ConfigureAwait(false); + try + { + var result = await new GithubUpdater(HttpClient, JsonSerializer).CheckForUpdateResult("MediaBrowser", + "Emby", + ApplicationVersion, + updateLevel, + ReleaseAssetFilename, + "MBServer", + UpdateTargetFileName, + cacheLength, + cancellationToken).ConfigureAwait(false); - HasUpdateAvailable = result.IsUpdateAvailable; + HasUpdateAvailable = result.IsUpdateAvailable; - return result; + return result; + } + catch (HttpException ex) + { + // users are overreacting to this occasionally failing + if (ex.StatusCode.HasValue && ex.StatusCode.Value == HttpStatusCode.Forbidden) + { + HasUpdateAvailable = false; + return new CheckForUpdateResult + { + IsUpdateAvailable = false + }; + } + + throw; + } } protected virtual string UpdateTargetFileName diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index 3e05653438..b06a6a8875 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -533,7 +533,7 @@ namespace Emby.Server.Implementations.HttpServer { stream.Dispose(); - return GetHttpResult(new byte[] { }, contentType, true); + return GetHttpResult(new byte[] { }, contentType, true, responseHeaders); } var hasHeaders = new StreamWriter(stream, contentType, _logger) diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs index a143bb9e3c..fbc5e1b375 100644 --- a/MediaBrowser.Model/Configuration/EncodingOptions.cs +++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs @@ -25,7 +25,8 @@ namespace MediaBrowser.Model.Configuration EnableThrottling = true; ThrottleDelaySeconds = 180; EncodingThreadCount = -1; - VaapiDevice = "/dev/dri/card0"; + // This is a DRM device that is almost guaranteed to be there on every intel platform, plus it's the default one in ffmpeg if you don't specify anything + VaapiDevice = "/dev/dri/renderD128"; H264Crf = 23; EnableHardwareEncoding = true; EnableSubtitleExtraction = true; diff --git a/MediaBrowser.Server.Mono/MonoAppHost.cs b/MediaBrowser.Server.Mono/MonoAppHost.cs index ded7bb5f3a..fe684d928d 100644 --- a/MediaBrowser.Server.Mono/MonoAppHost.cs +++ b/MediaBrowser.Server.Mono/MonoAppHost.cs @@ -26,7 +26,7 @@ namespace MediaBrowser.Server.Mono get { // A restart script must be provided - return StartupOptions.ContainsOption("-restartpath"); + return false; } } From 98f4da6d1471c51ef39fb87de01a1185bb41487e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 23 Sep 2017 21:09:51 -0400 Subject: [PATCH 2/2] 3.2.32.3 --- Emby.Server.Implementations/Data/SqliteItemRepository.cs | 4 ++-- SharedVersion.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 987b1df39b..bc4ab8315f 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -3750,7 +3750,7 @@ namespace Emby.Server.Implementations.Data if (query.MinDateLastSaved.HasValue) { - whereClauses.Add("DateLastSaved>=@MinDateLastSaved"); + whereClauses.Add("(DateLastSaved not null and DateLastSaved>=@MinDateLastSavedForUser)"); if (statement != null) { statement.TryBind("@MinDateLastSaved", query.MinDateLastSaved.Value); @@ -3759,7 +3759,7 @@ namespace Emby.Server.Implementations.Data if (query.MinDateLastSavedForUser.HasValue) { - whereClauses.Add("DateLastSaved>=@MinDateLastSavedForUser"); + whereClauses.Add("(DateLastSaved not null and DateLastSaved>=@MinDateLastSavedForUser)"); if (statement != null) { statement.TryBind("@MinDateLastSavedForUser", query.MinDateLastSavedForUser.Value); diff --git a/SharedVersion.cs b/SharedVersion.cs index 0dd93fc205..1dedc00f12 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.32.2")] +[assembly: AssemblyVersion("3.2.32.3")]