From 2481838b4a855d48bf0a7f1267893bbccf51c497 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 7 Aug 2016 17:57:46 -0400 Subject: [PATCH 01/10] fix people refresh progress display --- .../Library/Validators/PeopleValidator.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs index aa993d176..191c7ef28 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs @@ -115,6 +115,8 @@ namespace MediaBrowser.Server.Implementations.Library.Validators _logger.Debug("Will refresh {0} people", dict.Count); + var numPeople = dict.Count; + foreach (var person in dict) { cancellationToken.ThrowIfCancellationRequested(); @@ -124,7 +126,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators var item = _libraryManager.GetPerson(person.Key); var hasMetdata = !string.IsNullOrWhiteSpace(item.Overview); - var performFullRefresh = !hasMetdata && (DateTime.UtcNow - item.DateLastRefreshed).TotalDays >= 90; + var performFullRefresh = !hasMetdata && (DateTime.UtcNow - item.DateLastRefreshed).TotalDays >= 60; var defaultMetadataRefreshMode = performFullRefresh ? MetadataRefreshMode.FullRefresh @@ -155,7 +157,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators // Update progress numComplete++; double percent = numComplete; - percent /= people.Count; + percent /= numPeople; progress.Report(100 * percent); } From ce26f24ec7e7a1828e1bfa4c5d6377a37da433b9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 8 Aug 2016 00:35:21 -0400 Subject: [PATCH 02/10] remove X-Powered-By header --- .../HttpServer/HttpListenerHost.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index 5cf0a246f..90055d8ec 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -81,6 +81,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer {typeof (ApplicationException), 500} }; + HostConfig.Instance.GlobalResponseHeaders = new Dictionary(); HostConfig.Instance.DebugMode = false; HostConfig.Instance.LogFactory = LogManager.LogFactory; From d71a468388335d407ef73e933bddb59c4f2b4d1d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 8 Aug 2016 14:14:05 -0400 Subject: [PATCH 03/10] fix played filter for series --- MediaBrowser.Controller/Entities/Folder.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index bb3d4f73d..c1728ce38 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -13,6 +13,7 @@ using System.Threading; using System.Threading.Tasks; using CommonIO; using MediaBrowser.Controller.Channels; +using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Model.Channels; namespace MediaBrowser.Controller.Entities @@ -882,6 +883,15 @@ namespace MediaBrowser.Controller.Entities return true; } + if (query.IsPlayed.HasValue) + { + if (query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes.Contains(typeof(Series).Name)) + { + Logger.Debug("Query requires post-filtering due to IsPlayed"); + return true; + } + } + return false; } From e652b996b6d4ea46d897fa670309e15bbbef158b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 8 Aug 2016 14:18:32 -0400 Subject: [PATCH 04/10] 3.1.96 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index f10a80534..6d6ac0ab6 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; //[assembly: AssemblyVersion("3.1.*")] -[assembly: AssemblyVersion("3.1.95")] +[assembly: AssemblyVersion("3.1.96")] From bb0618f6083bb7dc8f5f7de7a65e2b8aa50f629b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 8 Aug 2016 18:15:37 -0400 Subject: [PATCH 05/10] fixes #2041 - Error when altering and saving user settings --- .../Serialization/XmlSerializer.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs b/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs index 756741e0d..77f65b0c7 100644 --- a/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs +++ b/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs @@ -1,6 +1,7 @@ using MediaBrowser.Model.Serialization; using System; using System.Collections.Concurrent; +using System.Collections.Generic; using System.IO; using System.Xml; using CommonIO; @@ -24,13 +25,22 @@ namespace MediaBrowser.Common.Implementations.Serialization // Need to cache these // http://dotnetcodebox.blogspot.com/2013/01/xmlserializer-class-may-result-in.html - private readonly ConcurrentDictionary _serializers = - new ConcurrentDictionary(); + private readonly Dictionary _serializers = + new Dictionary(); private System.Xml.Serialization.XmlSerializer GetSerializer(Type type) { var key = type.FullName; - return _serializers.GetOrAdd(key, k => new System.Xml.Serialization.XmlSerializer(type)); + lock (_serializers) + { + System.Xml.Serialization.XmlSerializer serializer; + if (!_serializers.TryGetValue(key, out serializer)) + { + serializer = new System.Xml.Serialization.XmlSerializer(type); + _serializers[key] = serializer; + } + return serializer; + } } /// From cbb6a9495db893211bced8f9c8ca845f91f2bc02 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 9 Aug 2016 01:08:21 -0400 Subject: [PATCH 06/10] exclude people from dynamic images --- .../UserViews/DynamicImageProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs b/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs index ea4da19b2..3c75c8a48 100644 --- a/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs +++ b/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs @@ -72,7 +72,7 @@ namespace MediaBrowser.Server.Implementations.UserViews User = view.UserId.HasValue ? _userManager.GetUserById(view.UserId.Value) : null, CollapseBoxSetItems = false, Recursive = recursive, - ExcludeItemTypes = new[] { "UserView", "CollectionFolder" } + ExcludeItemTypes = new[] { "UserView", "CollectionFolder", "Person" }, }).ConfigureAwait(false); From 112d5d63481f2002a08d5532072cee84df01116b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 9 Aug 2016 01:08:36 -0400 Subject: [PATCH 07/10] try to detect 3d type --- MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 6 ++++++ MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index f37e223de..9e9bc0780 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -168,6 +168,12 @@ namespace MediaBrowser.MediaEncoding.Probing } ExtractTimestamp(info); + + var stereoMode = GetDictionaryValue(tags, "stereo_mode"); + if (string.Equals(stereoMode, "left_right", StringComparison.OrdinalIgnoreCase)) + { + info.Video3DFormat = Video3DFormat.FullSideBySide; + } } return info; diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs index e1ab61cbb..c20823535 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs @@ -231,6 +231,8 @@ namespace MediaBrowser.Providers.MediaInfo video.HasSubtitles = mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle); video.Timestamp = mediaInfo.Timestamp; + video.Video3DFormat = video.Video3DFormat ?? mediaInfo.Video3DFormat; + await _itemRepo.SaveMediaStreams(video.Id, mediaStreams, cancellationToken).ConfigureAwait(false); if (options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh || From e52759786ff626d930ff3aa7375546d8efb5b975 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 9 Aug 2016 01:10:17 -0400 Subject: [PATCH 08/10] fix layout quirks --- MediaBrowser.Api/ApiEntryPoint.cs | 11 +++- .../BaseProgressiveStreamingService.cs | 62 +++++++++---------- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs index 1a7f4a2b1..bb9d2b864 100644 --- a/MediaBrowser.Api/ApiEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -63,6 +63,15 @@ namespace MediaBrowser.Api Instance = this; _sessionManager.PlaybackProgress += _sessionManager_PlaybackProgress; + _sessionManager.PlaybackStart += _sessionManager_PlaybackStart; + } + + private void _sessionManager_PlaybackStart(object sender, PlaybackProgressEventArgs e) + { + if (!string.IsNullOrWhiteSpace(e.PlaySessionId)) + { + PingTranscodingJob(e.PlaySessionId, e.IsPaused); + } } void _sessionManager_PlaybackProgress(object sender, PlaybackProgressEventArgs e) @@ -401,7 +410,7 @@ namespace MediaBrowser.Api } } - Logger.Debug("Transcoding kill timer stopped for JobId {0} PlaySessionId {1}. Killing transcoding", job.Id, job.PlaySessionId); + Logger.Info("Transcoding kill timer stopped for JobId {0} PlaySessionId {1}. Killing transcoding", job.Id, job.PlaySessionId); KillTranscodingJob(job, true, path => true); } diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs index 4649499c4..d6dea0fe5 100644 --- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs +++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs @@ -165,40 +165,40 @@ namespace MediaBrowser.Api.Playback.Progressive } } - // Not static but transcode cache file exists - if (isTranscodeCached) - { - var contentType = state.GetMimeType(outputPath); + //// Not static but transcode cache file exists + //if (isTranscodeCached && state.VideoRequest == null) + //{ + // var contentType = state.GetMimeType(outputPath); - try - { - if (transcodingJob != null) - { - ApiEntryPoint.Instance.OnTranscodeBeginRequest(transcodingJob); - } + // try + // { + // if (transcodingJob != null) + // { + // ApiEntryPoint.Instance.OnTranscodeBeginRequest(transcodingJob); + // } - return await ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions - { - ResponseHeaders = responseHeaders, - ContentType = contentType, - IsHeadRequest = isHeadRequest, - Path = outputPath, - FileShare = FileShare.ReadWrite, - OnComplete = () => - { - if (transcodingJob != null) - { - ApiEntryPoint.Instance.OnTranscodeEndRequest(transcodingJob); - } - } + // return await ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions + // { + // ResponseHeaders = responseHeaders, + // ContentType = contentType, + // IsHeadRequest = isHeadRequest, + // Path = outputPath, + // FileShare = FileShare.ReadWrite, + // OnComplete = () => + // { + // if (transcodingJob != null) + // { + // ApiEntryPoint.Instance.OnTranscodeEndRequest(transcodingJob); + // } + // } - }).ConfigureAwait(false); - } - finally - { - state.Dispose(); - } - } + // }).ConfigureAwait(false); + // } + // finally + // { + // state.Dispose(); + // } + //} // Need to start ffmpeg try From bfdd9e8936557fbeb9147f81c18b2b967cd7fb4a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 9 Aug 2016 01:13:23 -0400 Subject: [PATCH 09/10] 3.1.97 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 6d6ac0ab6..6dfb8bc40 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; //[assembly: AssemblyVersion("3.1.*")] -[assembly: AssemblyVersion("3.1.96")] +[assembly: AssemblyVersion("3.1.97")] From 94a4f11464700c0fb73b58b2515730224441d641 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 9 Aug 2016 13:31:31 -0400 Subject: [PATCH 10/10] update components --- MediaBrowser.Model/ApiClient/IApiClient.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index 904beb736..2e9f57087 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -302,6 +302,8 @@ namespace MediaBrowser.Model.ApiClient /// Task{ItemsResult}. Task GetSeasonsAsync(SeasonQuery query, CancellationToken cancellationToken = default(CancellationToken)); + Task GetRegistrationInfo(); + /// /// Queries for items ///