From 3ccecd3ca3a1640f15ffae70914a8ad0f5a1cb99 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 18 May 2014 15:58:42 -0400 Subject: channel fixes --- .../Channels/ChannelAudioItem.cs | 26 ++++++++++++++++++++-- .../Channels/ChannelCategoryItem.cs | 9 +++++++- .../Channels/ChannelItemInfo.cs | 2 ++ .../Channels/ChannelMediaInfo.cs | 3 +++ .../Channels/ChannelVideoItem.cs | 21 +++++++++++++++++ MediaBrowser.Controller/Channels/IChannel.cs | 11 +++++++++ MediaBrowser.Controller/Channels/IChannelItem.cs | 2 +- .../Channels/IChannelManager.cs | 8 +++++++ .../Channels/IChannelMediaItem.cs | 6 ++++- MediaBrowser.Controller/Entities/Audio/Audio.cs | 4 +++- .../Session/ISessionController.cs | 4 +++- 11 files changed, 89 insertions(+), 7 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs index 72a996b193..6d32f7d356 100644 --- a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs +++ b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs @@ -1,6 +1,8 @@ -using System.Linq; -using MediaBrowser.Controller.Entities.Audio; +using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Entities; +using System.Collections.Generic; +using System.Linq; namespace MediaBrowser.Controller.Channels { @@ -18,6 +20,8 @@ namespace MediaBrowser.Controller.Channels public string OriginalImageUrl { get; set; } + public List ChannelMediaSources { get; set; } + protected override bool GetBlockUnratedValue(UserConfiguration config) { return config.BlockUnratedItems.Contains(UnratedItem.ChannelContent); @@ -30,5 +34,23 @@ namespace MediaBrowser.Controller.Channels return false; } } + + public ChannelAudioItem() + { + ChannelMediaSources = new List(); + } + + public override LocationType LocationType + { + get + { + if (string.IsNullOrEmpty(Path)) + { + return LocationType.Remote; + } + + return base.LocationType; + } + } } } diff --git a/MediaBrowser.Controller/Channels/ChannelCategoryItem.cs b/MediaBrowser.Controller/Channels/ChannelCategoryItem.cs index b20dcf6204..c18f748563 100644 --- a/MediaBrowser.Controller/Channels/ChannelCategoryItem.cs +++ b/MediaBrowser.Controller/Channels/ChannelCategoryItem.cs @@ -1,5 +1,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Configuration; +using System.Collections.Generic; namespace MediaBrowser.Controller.Channels { @@ -8,10 +9,11 @@ namespace MediaBrowser.Controller.Channels public string ExternalId { get; set; } public string ChannelId { get; set; } - + public ChannelItemType ChannelItemType { get; set; } public string OriginalImageUrl { get; set; } + public List Tags { get; set; } protected override bool GetBlockUnratedValue(UserConfiguration config) { @@ -26,5 +28,10 @@ namespace MediaBrowser.Controller.Channels return false; } } + + public ChannelCategoryItem() + { + Tags = new List(); + } } } diff --git a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs index 7bb8d15fc3..948754e49e 100644 --- a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs +++ b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs @@ -19,6 +19,7 @@ namespace MediaBrowser.Controller.Channels public List Genres { get; set; } public List Studios { get; set; } + public List Tags { get; set; } public List People { get; set; } @@ -49,6 +50,7 @@ namespace MediaBrowser.Controller.Channels Genres = new List(); Studios = new List(); People = new List(); + Tags = new List(); ProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); } } diff --git a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs index 8105bf43cd..3630342679 100644 --- a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs +++ b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs @@ -18,9 +18,12 @@ namespace MediaBrowser.Controller.Channels public int? Height { get; set; } public int? AudioChannels { get; set; } + public bool IsRemote { get; set; } + public ChannelMediaInfo() { RequiredHttpHeaders = new Dictionary(); + IsRemote = true; } } } \ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs index 0d2bd933be..01438bfad6 100644 --- a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs +++ b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs @@ -1,6 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; +using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -20,6 +21,8 @@ namespace MediaBrowser.Controller.Channels public string OriginalImageUrl { get; set; } + public List ChannelMediaSources { get; set; } + public override string GetUserDataKey() { if (ContentType == ChannelMediaContentType.Trailer) @@ -55,5 +58,23 @@ namespace MediaBrowser.Controller.Channels return false; } } + + public ChannelVideoItem() + { + ChannelMediaSources = new List(); + } + + public override LocationType LocationType + { + get + { + if (string.IsNullOrEmpty(Path)) + { + return LocationType.Remote; + } + + return base.LocationType; + } + } } } diff --git a/MediaBrowser.Controller/Channels/IChannel.cs b/MediaBrowser.Controller/Channels/IChannel.cs index bd0bd64ea6..8a21179b11 100644 --- a/MediaBrowser.Controller/Channels/IChannel.cs +++ b/MediaBrowser.Controller/Channels/IChannel.cs @@ -59,4 +59,15 @@ namespace MediaBrowser.Controller.Channels /// IEnumerable{ImageType}. IEnumerable GetSupportedChannelImages(); } + + public interface IRequiresMediaInfoCallback + { + /// + /// Gets the channel item media information. + /// + /// The identifier. + /// The cancellation token. + /// Task{IEnumerable{ChannelMediaInfo}}. + Task> GetChannelItemMediaInfo(string id, CancellationToken cancellationToken); + } } diff --git a/MediaBrowser.Controller/Channels/IChannelItem.cs b/MediaBrowser.Controller/Channels/IChannelItem.cs index fc088b8886..8b97701138 100644 --- a/MediaBrowser.Controller/Channels/IChannelItem.cs +++ b/MediaBrowser.Controller/Channels/IChannelItem.cs @@ -2,7 +2,7 @@ namespace MediaBrowser.Controller.Channels { - public interface IChannelItem : IHasImages + public interface IChannelItem : IHasImages, IHasTags { string ChannelId { get; set; } diff --git a/MediaBrowser.Controller/Channels/IChannelManager.cs b/MediaBrowser.Controller/Channels/IChannelManager.cs index 05f9afcf00..a47f6e6aee 100644 --- a/MediaBrowser.Controller/Channels/IChannelManager.cs +++ b/MediaBrowser.Controller/Channels/IChannelManager.cs @@ -31,5 +31,13 @@ namespace MediaBrowser.Controller.Channels /// The cancellation token. /// Task{QueryResult{BaseItemDto}}. Task> GetChannelItems(ChannelItemQuery query, CancellationToken cancellationToken); + + /// + /// Gets the channel item media sources. + /// + /// The identifier. + /// The cancellation token. + /// Task{IEnumerable{ChannelMediaInfo}}. + Task> GetChannelItemMediaSources(string id, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/Channels/IChannelMediaItem.cs b/MediaBrowser.Controller/Channels/IChannelMediaItem.cs index 3a2c076e0a..1e634027f0 100644 --- a/MediaBrowser.Controller/Channels/IChannelMediaItem.cs +++ b/MediaBrowser.Controller/Channels/IChannelMediaItem.cs @@ -1,9 +1,13 @@ -namespace MediaBrowser.Controller.Channels +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Channels { public interface IChannelMediaItem : IChannelItem { bool IsInfiniteStream { get; set; } ChannelMediaContentType ContentType { get; set; } + + List ChannelMediaSources { get; set; } } } \ No newline at end of file diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 40b52b8861..dca645a750 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -10,16 +10,18 @@ namespace MediaBrowser.Controller.Entities.Audio /// /// Class Audio /// - public class Audio : BaseItem, IHasMediaStreams, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo + public class Audio : BaseItem, IHasMediaStreams, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo, IHasTags { public string FormatName { get; set; } public long? Size { get; set; } public string Container { get; set; } public int? TotalBitrate { get; set; } + public List Tags { get; set; } public Audio() { Artists = new List(); + Tags = new List(); } /// diff --git a/MediaBrowser.Controller/Session/ISessionController.cs b/MediaBrowser.Controller/Session/ISessionController.cs index 5f07b9ff80..d6dd7698e6 100644 --- a/MediaBrowser.Controller/Session/ISessionController.cs +++ b/MediaBrowser.Controller/Session/ISessionController.cs @@ -1,5 +1,6 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.Session; +using MediaBrowser.Model.System; using System.Threading; using System.Threading.Tasks; @@ -54,9 +55,10 @@ namespace MediaBrowser.Controller.Session /// /// Sends the restart required message. /// + /// The information. /// The cancellation token. /// Task. - Task SendRestartRequiredNotification(CancellationToken cancellationToken); + Task SendRestartRequiredNotification(SystemInfo info, CancellationToken cancellationToken); /// /// Sends the user data change info. -- cgit v1.2.3