diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-10-10 14:19:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-10 14:19:06 -0400 |
| commit | ebdb0753a1f72d19f59e30438a9a59778995ccaa (patch) | |
| tree | e0a73248bd4106795cc034ca5552c81852f45d68 /MediaBrowser.Controller | |
| parent | d6310048edc34ebfeae9b4977129c87481071835 (diff) | |
| parent | cb26cb94579b772fa7825c6769dc7ace38217168 (diff) | |
Merge pull request #2217 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/InternalItemsQuery.cs | 9 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveStream.cs | 15 |
2 files changed, 14 insertions, 10 deletions
diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs index 444f472ab..f375e1b1c 100644 --- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs +++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using MediaBrowser.Model.Configuration; using System.Linq; +using MediaBrowser.Controller.Dto; using MediaBrowser.Model.Querying; namespace MediaBrowser.Controller.Entities @@ -159,10 +160,12 @@ namespace MediaBrowser.Controller.Entities public DateTime? MinDateCreated { get; set; } public DateTime? MinDateLastSaved { get; set; } - public List<ItemFields> Fields { get; set; } + public DtoOptions DtoOptions { get; set; } public bool HasField(ItemFields name) { + var fields = DtoOptions.Fields; + switch (name) { case ItemFields.ProductionLocations: @@ -185,7 +188,7 @@ namespace MediaBrowser.Controller.Entities case ItemFields.Tags: case ItemFields.DateLastMediaAdded: case ItemFields.CriticRatingSummary: - return Fields.Count == 0 || Fields.Contains(name); + return fields.Count == 0 || fields.Contains(name); default: return true; } @@ -196,7 +199,7 @@ namespace MediaBrowser.Controller.Entities GroupByPresentationUniqueKey = true; EnableTotalRecordCount = true; - Fields = new List<ItemFields>(); + DtoOptions = new DtoOptions(); AlbumNames = new string[] { }; ArtistNames = new string[] { }; ExcludeArtistIds = new string[] { }; diff --git a/MediaBrowser.Controller/LiveTv/LiveStream.cs b/MediaBrowser.Controller/LiveTv/LiveStream.cs index a5d432a54..0908c3ecc 100644 --- a/MediaBrowser.Controller/LiveTv/LiveStream.cs +++ b/MediaBrowser.Controller/LiveTv/LiveStream.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.Dto; @@ -9,13 +10,16 @@ namespace MediaBrowser.Controller.LiveTv { public MediaSourceInfo OriginalMediaSource { get; set; } public MediaSourceInfo OpenedMediaSource { get; set; } - public DateTime DateOpened { get; set; } - public int ConsumerCount { get; set; } + public int ConsumerCount { + get { return SharedStreamIds.Count; } + } public ITunerHost TunerHost { get; set; } public string OriginalStreamId { get; set; } public bool EnableStreamSharing { get; set; } public string UniqueId = Guid.NewGuid().ToString("N"); + public List<string> SharedStreamIds = new List<string>(); + public LiveStream(MediaSourceInfo mediaSource) { OriginalMediaSource = mediaSource; @@ -23,12 +27,9 @@ namespace MediaBrowser.Controller.LiveTv EnableStreamSharing = true; } - public async Task Open(CancellationToken cancellationToken) + public Task Open(CancellationToken cancellationToken) { - await OpenInternal(cancellationToken).ConfigureAwait(false); - DateOpened = DateTime.UtcNow; - - OpenedMediaSource.DateLiveStreamOpened = DateOpened; + return OpenInternal(cancellationToken); } protected virtual Task OpenInternal(CancellationToken cancellationToken) |
