aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-03-14 15:44:54 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-03-14 15:44:54 -0400
commitf069559b1e9f27adf3816f7035bf3ee638404862 (patch)
treeb0f013310c0fb99ccb906d48101ce3bb1ef8baee /Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs
parent296e5bfe32bd0e859d20632b2f20eca6d00a698d (diff)
update tuner host interface
Diffstat (limited to 'Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs')
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs25
1 files changed, 22 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs
index 79fa9bb61f..c9cd289e7e 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs
@@ -135,8 +135,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
{
// Check to make sure the tuner is available
// If there's only one tuner, don't bother with the check and just let the tuner be the one to throw an error
- if (hostsWithChannel.Count > 1 &&
- !await IsAvailable(host, channelId, cancellationToken).ConfigureAwait(false))
+ if (hostsWithChannel.Count > 1 && !await IsAvailable(host, channelId, cancellationToken).ConfigureAwait(false))
{
Logger.Error("Tuner is not currently available");
continue;
@@ -208,6 +207,11 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
foreach (var host in hostsWithChannel)
{
+ if (!channelId.StartsWith(ChannelIdPrefix, StringComparison.OrdinalIgnoreCase))
+ {
+ continue;
+ }
+
try
{
var liveStream = await GetChannelStream(host, channelId, streamId, cancellationToken).ConfigureAwait(false);
@@ -243,7 +247,22 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
protected abstract Task<bool> IsAvailableInternal(TunerHostInfo tuner, string channelId, CancellationToken cancellationToken);
- protected abstract bool IsValidChannelId(string channelId);
+ protected virtual string ChannelIdPrefix
+ {
+ get
+ {
+ return Type + "_";
+ }
+ }
+ protected virtual bool IsValidChannelId(string channelId)
+ {
+ if (string.IsNullOrWhiteSpace(channelId))
+ {
+ throw new ArgumentNullException("channelId");
+ }
+
+ return channelId.StartsWith(ChannelIdPrefix, StringComparison.OrdinalIgnoreCase);
+ }
protected LiveTvOptions GetConfiguration()
{