From 94451de6d2730e028724b16ac6fbc1b0dfb86ff5 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 22 Dec 2016 10:58:09 -0500 Subject: improve ScheduleDirect showId --- .../LiveTv/Listings/SchedulesDirect.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Emby.Server.Implementations/LiveTv') diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs index 04fc78c958..e2446b16ff 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs @@ -422,7 +422,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings } var showType = details.showType ?? string.Empty; - + var info = new ProgramInfo { ChannelId = channel, @@ -440,10 +440,23 @@ namespace Emby.Server.Implementations.LiveTv.Listings IsKids = string.Equals(details.audience, "children", StringComparison.OrdinalIgnoreCase), IsSports = showType.IndexOf("sports", StringComparison.OrdinalIgnoreCase) != -1, IsMovie = showType.IndexOf("movie", StringComparison.OrdinalIgnoreCase) != -1 || showType.IndexOf("film", StringComparison.OrdinalIgnoreCase) != -1, - ShowId = programInfo.programID, Etag = programInfo.md5 }; + var showId = programInfo.programID ?? string.Empty; + + // According to SchedulesDirect, these are generic, unidentified episodes + // SH005316560000 + var hasUniqueShowId = !showId.StartsWith("SH", StringComparison.OrdinalIgnoreCase) || + !showId.EndsWith("0000", StringComparison.OrdinalIgnoreCase); + + if (!hasUniqueShowId) + { + showId = newID; + } + + info.ShowId = showId; + if (programInfo.videoProperties != null) { info.IsHD = programInfo.videoProperties.Contains("hdtv", StringComparer.OrdinalIgnoreCase); -- cgit v1.2.3 From e4ceec749d6df5d2596fe63ccb727220957b9692 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 22 Dec 2016 10:59:08 -0500 Subject: limit guide date picker to actual guide days --- Emby.Server.Implementations/LiveTv/LiveTvManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Emby.Server.Implementations/LiveTv') diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs index 525db4036d..62a0738c72 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs @@ -2647,7 +2647,7 @@ namespace Emby.Server.Implementations.LiveTv public GuideInfo GetGuideInfo() { var startDate = DateTime.UtcNow; - var endDate = startDate.AddDays(14); + var endDate = startDate.AddDays(GetGuideDays()); return new GuideInfo { -- cgit v1.2.3 From be390433dda8ec3afcc36b7c70ac78b06333e643 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 27 Dec 2016 15:42:02 -0500 Subject: supply user agent when direct recording --- Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Emby.Server.Implementations/LiveTv') diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs index 6d527c1cfb..ef440899cb 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs @@ -34,7 +34,13 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV var httpRequestOptions = new HttpRequestOptions { Url = mediaSource.Path, - BufferContent = false + BufferContent = false, + + // Some remote urls will expect a user agent to be supplied + UserAgent = "Emby/3.0", + + // Shouldn't matter but may cause issues + EnableHttpCompression = false }; using (var response = await _httpClient.SendAsync(httpRequestOptions, "GET").ConfigureAwait(false)) -- cgit v1.2.3