aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/LiveTv
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-12-28 16:13:12 -0500
committerGitHub <noreply@github.com>2016-12-28 16:13:12 -0500
commit2cb0f3eed635bb468b3672d08dca9a720b4fb48f (patch)
tree1a0d7c53ec148619ae966a81187413a33ca9a8a4 /Emby.Server.Implementations/LiveTv
parente47ccdce4247b93faa6d27849b255aac83324c42 (diff)
parentc10b152018967ddafe72efbccfe8ca6c586cbf04 (diff)
Merge pull request #2372 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations/LiveTv')
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs8
-rw-r--r--Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs17
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs2
3 files changed, 23 insertions, 4 deletions
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))
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);
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
{