jellyfin-server/Emby.Server.Implementations/Library/ExclusiveLiveStream.cs
Bond_009 07cc4be6a7 Fix some warnings
* Add analyzers to MediaBrowser.XbmcMetadata
* Enable TreatWarningsAsErrors for MediaBrowser.XbmcMetadata
* Add analyzers to MediaBrowser.WebDashboard
* Enable TreatWarningsAsErrors for MediaBrowser.WebDashboard
* Disable SA1600 in favor of CS1591
2020-02-23 12:11:43 +01:00

46 lines
1.2 KiB
C#

#pragma warning disable CS1591
using System;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
namespace Emby.Server.Implementations.Library
{
public class ExclusiveLiveStream : ILiveStream
{
public int ConsumerCount { get; set; }
public string OriginalStreamId { get; set; }
public string TunerHostId => null;
public bool EnableStreamSharing { get; set; }
public MediaSourceInfo MediaSource { get; set; }
public string UniqueId { get; private set; }
private Func<Task> _closeFn;
public ExclusiveLiveStream(MediaSourceInfo mediaSource, Func<Task> closeFn)
{
MediaSource = mediaSource;
EnableStreamSharing = false;
_closeFn = closeFn;
ConsumerCount = 1;
UniqueId = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
}
public Task Close()
{
return _closeFn();
}
public Task Open(CancellationToken openCancellationToken)
{
return Task.CompletedTask;
}
}
}