mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
Merge pull request #4200 from ryanpetris/hdhomerun-preemptive-livetv-conflict
HDHomeRun: Preemptively throw a LiveTvConflictException
This commit is contained in:
commit
7030e925b7
1 changed files with 13 additions and 0 deletions
|
@ -563,6 +563,19 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||||
|
|
||||||
protected override async Task<ILiveStream> GetChannelStream(TunerHostInfo info, ChannelInfo channelInfo, string streamId, List<ILiveStream> currentLiveStreams, CancellationToken cancellationToken)
|
protected override async Task<ILiveStream> GetChannelStream(TunerHostInfo info, ChannelInfo channelInfo, string streamId, List<ILiveStream> currentLiveStreams, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
var tunerCount = info.TunerCount;
|
||||||
|
|
||||||
|
if (tunerCount > 0)
|
||||||
|
{
|
||||||
|
var tunerHostId = info.Id;
|
||||||
|
var liveStreams = currentLiveStreams.Where(i => string.Equals(i.TunerHostId, tunerHostId, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
if (liveStreams.Count() >= tunerCount)
|
||||||
|
{
|
||||||
|
throw new LiveTvConflictException("HDHomeRun simultaneous stream limit has been reached.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var profile = streamId.Split('_')[0];
|
var profile = streamId.Split('_')[0];
|
||||||
|
|
||||||
Logger.LogInformation("GetChannelStream: channel id: {0}. stream id: {1} profile: {2}", channelInfo.Id, streamId, profile);
|
Logger.LogInformation("GetChannelStream: channel id: {0}. stream id: {1} profile: {2}", channelInfo.Id, streamId, profile);
|
||||||
|
|
Loading…
Reference in a new issue