aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-02-24 13:45:11 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-02-24 13:45:11 -0500
commit1b4dbe88948f9b7103bbdd51427c4a93b102037e (patch)
tree4f2980974589f4c69e7fa8482022c14cd1092930
parent631bfb8ed225d4683d8fea42590a12dd83a1c0c4 (diff)
update channel ids
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvOptions.cs2
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs26
2 files changed, 16 insertions, 12 deletions
diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
index 50c41fd21..095fa95e1 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
@@ -31,7 +31,6 @@ namespace MediaBrowser.Model.LiveTv
public string Type { get; set; }
public bool ImportFavoritesOnly { get; set; }
public bool IsEnabled { get; set; }
- public string GuideGroup { get; set; }
public TunerHostInfo()
{
@@ -49,6 +48,5 @@ namespace MediaBrowser.Model.LiveTv
public string ZipCode { get; set; }
public string Country { get; set; }
public string Path { get; set; }
- public string GuideGroup { get; set; }
}
} \ No newline at end of file
diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs
index 013dabe26..ca7d0e119 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs
@@ -14,6 +14,7 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dlna;
@@ -64,7 +65,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
{
Name = i.GuideName,
Number = i.GuideNumber.ToString(CultureInfo.InvariantCulture),
- Id = ChannelIdPrefix + i.GuideNumber.ToString(CultureInfo.InvariantCulture),
+ Id = ChannelIdPrefix + i.GuideNumber.ToString(CultureInfo.InvariantCulture) + '_' + (i.GuideName ?? string.Empty).GetMD5().ToString("N"),
IsFavorite = i.Favorite
});
@@ -347,6 +348,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
return Config.GetConfiguration<EncodingOptions>("encoding");
}
+ private string GetHdHrIdFromChannelId(string channelId)
+ {
+ return channelId.Split('_')[1];
+ }
+
protected override async Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(TunerHostInfo info, string channelId, CancellationToken cancellationToken)
{
var list = new List<MediaSourceInfo>();
@@ -355,9 +361,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
{
return list;
}
- channelId = channelId.Substring(ChannelIdPrefix.Length);
+ var hdhrId = GetHdHrIdFromChannelId(channelId);
- list.Add(GetMediaSource(info, channelId, "native"));
+ list.Add(GetMediaSource(info, hdhrId, "native"));
try
{
@@ -366,12 +372,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
if (model.IndexOf("hdtc", StringComparison.OrdinalIgnoreCase) != -1)
{
- list.Insert(0, GetMediaSource(info, channelId, "heavy"));
+ list.Insert(0, GetMediaSource(info, hdhrId, "heavy"));
- list.Add(GetMediaSource(info, channelId, "internet480"));
- list.Add(GetMediaSource(info, channelId, "internet360"));
- list.Add(GetMediaSource(info, channelId, "internet240"));
- list.Add(GetMediaSource(info, channelId, "mobile"));
+ list.Add(GetMediaSource(info, hdhrId, "internet480"));
+ list.Add(GetMediaSource(info, hdhrId, "internet360"));
+ list.Add(GetMediaSource(info, hdhrId, "internet240"));
+ list.Add(GetMediaSource(info, hdhrId, "mobile"));
}
}
catch (Exception ex)
@@ -400,9 +406,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
{
throw new ArgumentException("Channel not found");
}
- channelId = channelId.Substring(ChannelIdPrefix.Length);
+ var hdhrId = GetHdHrIdFromChannelId(channelId);
- return GetMediaSource(info, channelId, streamId);
+ return GetMediaSource(info, hdhrId, streamId);
}
public async Task Validate(TunerHostInfo info)