mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 09:04:42 +01:00
update closing of streams
This commit is contained in:
@@ -101,6 +101,8 @@ namespace MediaBrowser.Controller.Entities
|
||||
public bool? IsMovie { get; set; }
|
||||
public bool? IsSports { get; set; }
|
||||
public bool? IsKids { get; set; }
|
||||
public bool? IsNews { get; set; }
|
||||
public bool? IsSeries { get; set; }
|
||||
|
||||
public int? MinPlayers { get; set; }
|
||||
public int? MaxPlayers { get; set; }
|
||||
|
||||
@@ -92,8 +92,7 @@ namespace MediaBrowser.Controller.Library
|
||||
/// Closes the media source.
|
||||
/// </summary>
|
||||
/// <param name="id">The live stream identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task CloseLiveStream(string id, CancellationToken cancellationToken);
|
||||
Task CloseLiveStream(string id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,7 @@ namespace MediaBrowser.Controller.Library
|
||||
/// Closes the media source.
|
||||
/// </summary>
|
||||
/// <param name="liveStreamId">The live stream identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task CloseMediaSource(string liveStreamId, CancellationToken cancellationToken);
|
||||
Task CloseMediaSource(string liveStreamId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,9 +220,8 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
/// Closes the live stream.
|
||||
/// </summary>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task CloseLiveStream(string id, CancellationToken cancellationToken);
|
||||
Task CloseLiveStream(string id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the guide information.
|
||||
|
||||
@@ -22,9 +22,8 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
/// <summary>
|
||||
/// Gets the channels.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task<IEnumerable<ChannelInfo>>.</returns>
|
||||
Task<IEnumerable<ChannelInfo>> GetChannels(CancellationToken cancellationToken);
|
||||
Task<IEnumerable<ChannelInfo>> GetChannels(bool enableCache, CancellationToken cancellationToken);
|
||||
/// <summary>
|
||||
/// Gets the tuner infos.
|
||||
/// </summary>
|
||||
@@ -46,8 +45,6 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task<List<MediaSourceInfo>>.</returns>
|
||||
Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
|
||||
|
||||
string ApplyDuration(string streamPath, TimeSpan duration);
|
||||
}
|
||||
public interface IConfigurableTunerHost
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Threading;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Dto;
|
||||
|
||||
@@ -7,17 +8,27 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
public class LiveStream
|
||||
{
|
||||
public MediaSourceInfo OriginalMediaSource { get; set; }
|
||||
public MediaSourceInfo PublicMediaSource { get; set; }
|
||||
public string Id { get; set; }
|
||||
public MediaSourceInfo OpenedMediaSource { get; set; }
|
||||
public DateTime DateOpened { get; set; }
|
||||
public int ConsumerCount { get; set; }
|
||||
public ITunerHost TunerHost { get; set; }
|
||||
public string OriginalStreamId { get; set; }
|
||||
|
||||
public LiveStream(MediaSourceInfo mediaSource)
|
||||
{
|
||||
OriginalMediaSource = mediaSource;
|
||||
PublicMediaSource = mediaSource;
|
||||
Id = mediaSource.Id;
|
||||
OpenedMediaSource = mediaSource;
|
||||
}
|
||||
|
||||
public virtual Task Open(CancellationToken cancellationToken)
|
||||
public async Task Open(CancellationToken cancellationToken)
|
||||
{
|
||||
await OpenInternal(cancellationToken).ConfigureAwait(false);
|
||||
DateOpened = DateTime.UtcNow;
|
||||
|
||||
OpenedMediaSource.DateLiveStreamOpened = DateOpened;
|
||||
}
|
||||
|
||||
protected virtual Task OpenInternal(CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Serialization;
|
||||
|
||||
namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
public class LiveTvChannel : BaseItem, IHasMediaSources
|
||||
public class LiveTvChannel : BaseItem, IHasMediaSources, IHasProgramAttributes
|
||||
{
|
||||
public override List<string> GetUserDataKeys()
|
||||
{
|
||||
@@ -137,5 +137,56 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public bool IsMovie { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is sports.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
|
||||
[IgnoreDataMember]
|
||||
public bool IsSports { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is series.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
|
||||
[IgnoreDataMember]
|
||||
public bool IsSeries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is live.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
|
||||
[IgnoreDataMember]
|
||||
public bool IsLive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is news.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
|
||||
[IgnoreDataMember]
|
||||
public bool IsNews { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is kids.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
|
||||
[IgnoreDataMember]
|
||||
public bool IsKids { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
public bool IsPremiere { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
public bool IsRepeat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the episode title.
|
||||
/// </summary>
|
||||
/// <value>The episode title.</value>
|
||||
[IgnoreDataMember]
|
||||
public string EpisodeTitle { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
public bool IsMovie { get; set; }
|
||||
public bool IsKids { get; set; }
|
||||
public bool IsSports { get; set; }
|
||||
public bool IsNews { get; set; }
|
||||
public int? ProductionYear { get; set; }
|
||||
public string EpisodeTitle { get; set; }
|
||||
public DateTime? OriginalAirDate { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user