From 0828a3b532473ecac84f4553e7cef1f7fc96e4d8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 7 Jul 2016 23:44:30 -0400 Subject: [PATCH 01/13] update mac icon --- MediaBrowser.Server.Mac/statusicon.png | Bin 937 -> 922 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/MediaBrowser.Server.Mac/statusicon.png b/MediaBrowser.Server.Mac/statusicon.png index 9b2cdd8a0da766fd475aebb0c4faae38814d9ba8..8f12695059a8fc1573f7b8c5be6afb747521150d 100644 GIT binary patch literal 922 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|#^NA%Cx&(BWL^R}oCO|{#S9GG z!XV7ZFl&wkP(fs7NJL45ua8x7ey(0(N`6wRUPW#JP&EUCO@$SZnVVXYs8ErclUHn2 zVXFjIVFhG^g!Ppaz)DK8ZIvQ?0~DO|i&7O#^-S~(l1AfjnEK zjFOT9D}DX)@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7USFmqf|i<65o z3raHc^AtelCMM;Vme?vOfh>Xph&xL%(-1c06+^uR^q@XSM&D4+Kp$>4P^%3{)XKjo zGZknv$b36P8?Z_gF{nK@`XI}Z90TzwSQO}0J1!f2c(B=V`5aP@1P1agPZ!4!3&GyW z-hNDu0&UeUB}pnW4bD3Rg~O#n!lX))OPu#`K2Lb<c7ohVo(U<(blK9Bw7d3j3LkXV5qR=5 z(k00`;ib-9ANyxwPxl7wjOokXI*aq6ppoG<{Y5GU_gP-EoI2j*Tevsw{Wl@+BsI6P zX{KMJh5NJvL*7;CePdy7(&%C0lZi&%5ZoO&Q=9CicRWd1d+gKfqKACnWdl{O< zUVZwxlBt8?_dC{f>zcnFZ@8=uc^}#J%V_rAsa{LpE6v$0ChB-_vq;k#xueYv6G{cz z64&3&+nuyg!eq8@>mJ2Ej^-#)|0b!;-{w9ra9exggqpQ&M@PhMNslx>>6ctgm;?wG7+1~kFNbC6#VHTh5ID`4}&D&X^4CCqQ=d#Wzp$PzkHB@K- delta 901 zcmV;01A6?L2dM{;F@FSSK}|sb0I`n?{9y$E000SaNLh0L01FZT01FZU(%pXi0000Q zbVXQnQ*UN;cVTj608n9RZgehAMN}YmGcGkQF)>H;LN@>a0~kp}K~y+T-I7U9Qvno( zUwr%sp&$;37{O>zTCt#DkwGlt3__uxlo<FgU&W0IJ*gWA=#1w!Qj&Z&lw zryD_z<|$IDhhN)kD`D}fZK?+&5Lb1eP~D9}O%EiRUX6>P->WJ;fWVUN}`rv)?8h>`4ssc0qCU(ZFv5lv~*-A5V z6y3O>w!l387A1yp$XX^))?$V6`5a7>?@;u363KO=6tN{-Vw2tKgl9w%ydtG==Stxg zQ3j8r75KKe1Z~S0Znr;!-t-&|JyU43%s^821l1iAP?{#8?VCls+CmWVG?+z28NP=CLj$7aIS&>k;TwP3 zg?`Pq4UE3T;Mf!f$EWGcVDQ;2hJMBRGo{*gxP_iyvVYS`X!#Ul7Z1+66R>H28nlKk zSjK13KQ@D$k~?tSm+?D+8Gje8-f?`y(I<+cms0dX%9))&`5Zn+d4^?CF8+c)GjFf` be-OlX$oS`Z(o~^T00000NkvXXu0mjfmkFTA From 7b58f3a89a8d0219f72f64d90bb553cfa81f4751 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 7 Jul 2016 23:52:19 -0400 Subject: [PATCH 02/13] 3.0.5985 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 9b08f2128..cb7878468 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; //[assembly: AssemblyVersion("3.1.*")] -[assembly: AssemblyVersion("3.0.5984")] +[assembly: AssemblyVersion("3.0.5985")] From 121bff54d990452efb31eac05b53d63e655c0f15 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 8 Jul 2016 00:00:37 -0400 Subject: [PATCH 03/13] add startup null check --- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 383e93758..897684b73 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -152,7 +152,7 @@ namespace MediaBrowser.MediaEncoding.Encoder { var directory = Path.GetDirectoryName(FFMpegPath); - if (FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.ProgramDataPath, directory)) + if (!string.IsNullOrWhiteSpace(directory) && FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.ProgramDataPath, directory)) { await new FontConfigLoader(_httpClient, ConfigurationManager.ApplicationPaths, _logger, _zipClient, FileSystem).DownloadFonts(directory).ConfigureAwait(false); From 293b6b540f51036108808000bb19fc6bc326a24a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 8 Jul 2016 14:10:38 -0400 Subject: [PATCH 04/13] fix saving of country code in nfo --- MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs index 42f0a3364..954fb2a47 100644 --- a/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs +++ b/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs @@ -99,7 +99,9 @@ namespace MediaBrowser.XbmcMetadata.Savers "collectionitem", "isuserfavorite", - "userrating" + "userrating", + + "countrycode" }.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase); From 5b4fb95fd1e93806be890e736d7079f8943a5b7f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 8 Jul 2016 14:11:13 -0400 Subject: [PATCH 05/13] add null checks to get theme media --- MediaBrowser.Api/Library/LibraryService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 4cd6a66ef..1949dea12 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -839,6 +839,7 @@ namespace MediaBrowser.Api.Library var dtoOptions = GetDtoOptions(request); var dtos = GetThemeSongIds(item).Select(_libraryManager.GetItemById) + .Where(i => i != null) .OrderBy(i => i.SortName) .Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)); @@ -882,6 +883,7 @@ namespace MediaBrowser.Api.Library var dtoOptions = GetDtoOptions(request); var dtos = GetThemeVideoIds(item).Select(_libraryManager.GetItemById) + .Where(i => i != null) .OrderBy(i => i.SortName) .Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)); From f494ec86559b5c80f4e3a979534ca7169bfee03c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 10 Jul 2016 11:43:33 -0400 Subject: [PATCH 06/13] fix episodes with dlna --- MediaBrowser.Dlna/Didl/DidlBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Dlna/Didl/DidlBuilder.cs b/MediaBrowser.Dlna/Didl/DidlBuilder.cs index 0a15491b6..84c1b3bde 100644 --- a/MediaBrowser.Dlna/Didl/DidlBuilder.cs +++ b/MediaBrowser.Dlna/Didl/DidlBuilder.cs @@ -820,7 +820,7 @@ namespace MediaBrowser.Dlna.Didl var episode = item as Episode; if (episode != null) { - var parent = (BaseItem)episode.Series ?? episode.Season; + var parent = episode.Series; if (parent != null) { imageInfo = GetImageInfo(parent); From f8903dba6adc34e128a55072f96f94235a3cd5e3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 12 Jul 2016 00:09:13 -0400 Subject: [PATCH 07/13] fix episode display --- MediaBrowser.Controller/Entities/TV/Series.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index 09ddbc6b6..ad35b3d36 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -449,13 +449,8 @@ namespace MediaBrowser.Controller.Entities.TV return true; } - if (!episode.ParentIndexNumber.HasValue) - { - var season = episode.Season; - return season != null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase); - } - - return false; + var season = episode.Season; + return season != null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase); }); } From 7ea5608683500615815e8b4de8f5f82f426f3dc5 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 12 Jul 2016 13:16:34 -0400 Subject: [PATCH 08/13] add safeguard on interval trigger duration --- MediaBrowser.Common/ScheduledTasks/IntervalTrigger.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Common/ScheduledTasks/IntervalTrigger.cs b/MediaBrowser.Common/ScheduledTasks/IntervalTrigger.cs index 5107db6c4..8038d5551 100644 --- a/MediaBrowser.Common/ScheduledTasks/IntervalTrigger.cs +++ b/MediaBrowser.Common/ScheduledTasks/IntervalTrigger.cs @@ -60,7 +60,15 @@ namespace MediaBrowser.Common.ScheduledTasks triggerDate = DateTime.UtcNow.AddMinutes(1); } - Timer = new Timer(state => OnTriggered(), null, triggerDate - DateTime.UtcNow, TimeSpan.FromMilliseconds(-1)); + var dueTime = triggerDate - DateTime.UtcNow; + var maxDueTime = TimeSpan.FromDays(7); + + if (dueTime > maxDueTime) + { + dueTime = maxDueTime; + } + + Timer = new Timer(state => OnTriggered(), null, dueTime, TimeSpan.FromMilliseconds(-1)); } /// From 7117f78651f21efae21c3337dab9d42a4c461a64 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 12 Jul 2016 01:44:07 -0400 Subject: [PATCH 09/13] fix error when transcode fails to start --- MediaBrowser.Api/ApiEntryPoint.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs index a677bc600..dc811812a 100644 --- a/MediaBrowser.Api/ApiEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -237,9 +237,12 @@ namespace MediaBrowser.Api { lock (_activeTranscodingJobs) { - var job = _activeTranscodingJobs.First(j => j.Type == type && string.Equals(j.Path, path, StringComparison.OrdinalIgnoreCase)); + var job = _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && string.Equals(j.Path, path, StringComparison.OrdinalIgnoreCase)); - _activeTranscodingJobs.Remove(job); + if (job != null) + { + _activeTranscodingJobs.Remove(job); + } } if (!string.IsNullOrWhiteSpace(state.Request.DeviceId)) From 0ccbaf025ad1ab8605caf74d57509e499c555d1b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 13 Jul 2016 13:46:04 -0400 Subject: [PATCH 10/13] update hls subtitle display name --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 780e20f87..8ea279f1a 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -572,13 +572,11 @@ namespace MediaBrowser.Api.Playback.Hls { const string format = "#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID=\"subs\",NAME=\"{0}\",DEFAULT={1},FORCED={2},AUTOSELECT=YES,URI=\"{3}\",LANGUAGE=\"{4}\""; - var name = stream.Language; + var name = stream.DisplayTitle; var isDefault = selectedIndex.HasValue && selectedIndex.Value == stream.Index; var isForced = stream.IsForced; - if (string.IsNullOrWhiteSpace(name)) name = stream.Codec ?? "Unknown"; - var url = string.Format("{0}/Subtitles/{1}/subtitles.m3u8?SegmentLength={2}&api_key={3}", state.Request.MediaSourceId, stream.Index.ToString(UsCulture), From 8cce9d5f6f6b35e2f89c6238f804bd908832b4f3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 13 Jul 2016 15:09:31 -0400 Subject: [PATCH 11/13] add all subtitles to hls manifest --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 2 +- MediaBrowser.Api/Playback/StreamRequest.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 8ea279f1a..36ab20f0f 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -525,7 +525,7 @@ namespace MediaBrowser.Api.Playback.Hls var subtitleGroup = subtitleStreams.Count > 0 && request is GetMasterHlsVideoPlaylist && - ((GetMasterHlsVideoPlaylist)request).SubtitleMethod == SubtitleDeliveryMethod.Hls ? + (((GetMasterHlsVideoPlaylist)request).SubtitleMethod == SubtitleDeliveryMethod.Hls || ((GetMasterHlsVideoPlaylist)request).EnableSubtitlesInManifest) ? "subs" : null; diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs index 370915ec3..a8ca6aaa3 100644 --- a/MediaBrowser.Api/Playback/StreamRequest.cs +++ b/MediaBrowser.Api/Playback/StreamRequest.cs @@ -194,6 +194,8 @@ namespace MediaBrowser.Api.Playback public bool ForceLiveStream { get; set; } + public bool EnableSubtitlesInManifest { get; set; } + public VideoStreamRequest() { EnableAutoStreamCopy = true; From 75c0371835c900b598e7178e43faa8dfe6e267e2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 13 Jul 2016 15:16:51 -0400 Subject: [PATCH 12/13] update hls subtitles --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 8 ++++++++ MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 8 +++++++- MediaBrowser.Model/Dlna/StreamBuilder.cs | 1 + MediaBrowser.Model/Dlna/StreamInfo.cs | 2 ++ MediaBrowser.Model/Dlna/TranscodingProfile.cs | 3 +++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 27b675294..0b4e5efe8 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1554,6 +1554,13 @@ namespace MediaBrowser.Api.Playback { request.TranscodingMaxAudioChannels = int.Parse(val, UsCulture); } + else if (i == 28) + { + if (videoRequest != null) + { + videoRequest.EnableSubtitlesInManifest = string.Equals("true", val, StringComparison.OrdinalIgnoreCase); + } + } } } @@ -2126,6 +2133,7 @@ namespace MediaBrowser.Api.Playback { state.VideoRequest.CopyTimestamps = transcodingProfile.CopyTimestamps; state.VideoRequest.ForceLiveStream = transcodingProfile.ForceLiveStream; + state.VideoRequest.EnableSubtitlesInManifest = transcodingProfile.EnableSubtitlesInManifest; } } } diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 36ab20f0f..f4ecf3693 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -525,10 +525,16 @@ namespace MediaBrowser.Api.Playback.Hls var subtitleGroup = subtitleStreams.Count > 0 && request is GetMasterHlsVideoPlaylist && - (((GetMasterHlsVideoPlaylist)request).SubtitleMethod == SubtitleDeliveryMethod.Hls || ((GetMasterHlsVideoPlaylist)request).EnableSubtitlesInManifest) ? + (state.VideoRequest.SubtitleMethod == SubtitleDeliveryMethod.Hls || state.VideoRequest.EnableSubtitlesInManifest) ? "subs" : null; + // If we're burning in subtitles then don't add additional subs to the manifest + if (state.SubtitleStream != null && state.VideoRequest.SubtitleMethod == SubtitleDeliveryMethod.Encode) + { + subtitleGroup = null; + } + if (!string.IsNullOrWhiteSpace(subtitleGroup)) { AddSubtitles(state, subtitleStreams, builder); diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 41efa51b9..b204cf14e 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -452,6 +452,7 @@ namespace MediaBrowser.Model.Dlna playlistItem.VideoCodec = transcodingProfile.VideoCodec; playlistItem.CopyTimestamps = transcodingProfile.CopyTimestamps; playlistItem.ForceLiveStream = transcodingProfile.ForceLiveStream; + playlistItem.EnableSubtitlesInManifest = transcodingProfile.EnableSubtitlesInManifest; if (!string.IsNullOrEmpty(transcodingProfile.MaxAudioChannels)) { diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index 43a31f649..f95c6a070 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -37,6 +37,7 @@ namespace MediaBrowser.Model.Dlna public bool CopyTimestamps { get; set; } public bool ForceLiveStream { get; set; } + public bool EnableSubtitlesInManifest { get; set; } public string[] AudioCodecs { get; set; } public int? AudioStreamIndex { get; set; } @@ -249,6 +250,7 @@ namespace MediaBrowser.Model.Dlna list.Add(new NameValuePair("SubtitleMethod", item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External ? item.SubtitleDeliveryMethod.ToString() : string.Empty)); list.Add(new NameValuePair("TranscodingMaxAudioChannels", item.TranscodingMaxAudioChannels.HasValue ? StringHelper.ToStringCultureInvariant(item.TranscodingMaxAudioChannels.Value) : string.Empty)); + list.Add(new NameValuePair("EnableSubtitlesInManifest", item.EnableSubtitlesInManifest.ToString().ToLower())); return list; } diff --git a/MediaBrowser.Model/Dlna/TranscodingProfile.cs b/MediaBrowser.Model/Dlna/TranscodingProfile.cs index d1314c17b..19caf85eb 100644 --- a/MediaBrowser.Model/Dlna/TranscodingProfile.cs +++ b/MediaBrowser.Model/Dlna/TranscodingProfile.cs @@ -38,6 +38,9 @@ namespace MediaBrowser.Model.Dlna [XmlAttribute("forceLiveStream")] public bool ForceLiveStream { get; set; } + [XmlAttribute("enableSubtitlesInManifest")] + public bool EnableSubtitlesInManifest { get; set; } + [XmlAttribute("maxAudioChannels")] public string MaxAudioChannels { get; set; } From 739ad6e1df824799416a6bcf52eeea09c674d7d4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 14 Jul 2016 14:29:07 -0400 Subject: [PATCH 13/13] 3.0.5986 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index cb7878468..a452789cf 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; //[assembly: AssemblyVersion("3.1.*")] -[assembly: AssemblyVersion("3.0.5985")] +[assembly: AssemblyVersion("3.0.5986")]