aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-09-29 08:55:49 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-09-29 08:55:49 -0400
commit76c7bfcb6795771cb06ef354fbf76d6e39de8948 (patch)
treeb37dfa760d21cbc36395574dfb64c28ac69e9927 /MediaBrowser.Controller
parentf5d37ed659d88bfa00483deddbbf93c33c2e10d6 (diff)
update closing of streams
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Entities/InternalItemsQuery.cs2
-rw-r--r--MediaBrowser.Controller/Library/IMediaSourceManager.cs3
-rw-r--r--MediaBrowser.Controller/Library/IMediaSourceProvider.cs3
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvManager.cs3
-rw-r--r--MediaBrowser.Controller/LiveTv/ITunerHost.cs5
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveStream.cs23
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvChannel.cs53
-rw-r--r--MediaBrowser.Controller/LiveTv/TimerInfo.cs1
8 files changed, 76 insertions, 17 deletions
diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
index deea63112..d917b7d6d 100644
--- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
+++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
@@ -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; }
diff --git a/MediaBrowser.Controller/Library/IMediaSourceManager.cs b/MediaBrowser.Controller/Library/IMediaSourceManager.cs
index 1df77cdc9..c06470c5e 100644
--- a/MediaBrowser.Controller/Library/IMediaSourceManager.cs
+++ b/MediaBrowser.Controller/Library/IMediaSourceManager.cs
@@ -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);
}
}
diff --git a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs
index 5b033af4a..56366e5a8 100644
--- a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs
+++ b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs
@@ -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);
}
}
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
index 41c5dbdbb..d65d1ae30 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
@@ -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.
diff --git a/MediaBrowser.Controller/LiveTv/ITunerHost.cs b/MediaBrowser.Controller/LiveTv/ITunerHost.cs
index 3c8b964a2..89d035649 100644
--- a/MediaBrowser.Controller/LiveTv/ITunerHost.cs
+++ b/MediaBrowser.Controller/LiveTv/ITunerHost.cs
@@ -22,9 +22,8 @@ namespace MediaBrowser.Controller.LiveTv
/// <summary>
/// Gets the channels.
/// </summary>
- /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;IEnumerable&lt;ChannelInfo&gt;&gt;.</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&lt;List&lt;MediaSourceInfo&gt;&gt;.</returns>
Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
-
- string ApplyDuration(string streamPath, TimeSpan duration);
}
public interface IConfigurableTunerHost
{
diff --git a/MediaBrowser.Controller/LiveTv/LiveStream.cs b/MediaBrowser.Controller/LiveTv/LiveStream.cs
index 15d09d857..1bb198632 100644
--- a/MediaBrowser.Controller/LiveTv/LiveStream.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveStream.cs
@@ -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);
}
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs
index 50aeed27d..69a1c24ea 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs
@@ -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; }
}
}
diff --git a/MediaBrowser.Controller/LiveTv/TimerInfo.cs b/MediaBrowser.Controller/LiveTv/TimerInfo.cs
index 42c3480ce..978e9e1a8 100644
--- a/MediaBrowser.Controller/LiveTv/TimerInfo.cs
+++ b/MediaBrowser.Controller/LiveTv/TimerInfo.cs
@@ -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; }