diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-05-18 15:58:42 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-05-18 15:58:42 -0400 |
| commit | 3ccecd3ca3a1640f15ffae70914a8ad0f5a1cb99 (patch) | |
| tree | 737ee22469a54e14e4f4fa497a3216578b2d0983 /MediaBrowser.Controller | |
| parent | ca5989cb17b324ee481b92ddf3cd1ea47af85cbe (diff) | |
channel fixes
Diffstat (limited to 'MediaBrowser.Controller')
11 files changed, 89 insertions, 7 deletions
diff --git a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs index 72a996b19..6d32f7d35 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<ChannelMediaInfo> 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<ChannelMediaInfo>(); + } + + 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 b20dcf620..c18f74856 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<string> Tags { get; set; } protected override bool GetBlockUnratedValue(UserConfiguration config) { @@ -26,5 +28,10 @@ namespace MediaBrowser.Controller.Channels return false; } } + + public ChannelCategoryItem() + { + Tags = new List<string>(); + } } } diff --git a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs index 7bb8d15fc..948754e49 100644 --- a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs +++ b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs @@ -19,6 +19,7 @@ namespace MediaBrowser.Controller.Channels public List<string> Genres { get; set; } public List<string> Studios { get; set; } + public List<string> Tags { get; set; } public List<PersonInfo> People { get; set; } @@ -49,6 +50,7 @@ namespace MediaBrowser.Controller.Channels Genres = new List<string>(); Studios = new List<string>(); People = new List<PersonInfo>(); + Tags = new List<string>(); ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); } } diff --git a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs index 8105bf43c..363034267 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<string, string>(); + IsRemote = true; } } }
\ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs index 0d2bd933b..01438bfad 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<ChannelMediaInfo> 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<ChannelMediaInfo>(); + } + + 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 bd0bd64ea..8a21179b1 100644 --- a/MediaBrowser.Controller/Channels/IChannel.cs +++ b/MediaBrowser.Controller/Channels/IChannel.cs @@ -59,4 +59,15 @@ namespace MediaBrowser.Controller.Channels /// <returns>IEnumerable{ImageType}.</returns> IEnumerable<ImageType> GetSupportedChannelImages(); } + + public interface IRequiresMediaInfoCallback + { + /// <summary> + /// Gets the channel item media information. + /// </summary> + /// <param name="id">The identifier.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task{IEnumerable{ChannelMediaInfo}}.</returns> + Task<IEnumerable<ChannelMediaInfo>> GetChannelItemMediaInfo(string id, CancellationToken cancellationToken); + } } diff --git a/MediaBrowser.Controller/Channels/IChannelItem.cs b/MediaBrowser.Controller/Channels/IChannelItem.cs index fc088b888..8b9770113 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 05f9afcf0..a47f6e6ae 100644 --- a/MediaBrowser.Controller/Channels/IChannelManager.cs +++ b/MediaBrowser.Controller/Channels/IChannelManager.cs @@ -31,5 +31,13 @@ namespace MediaBrowser.Controller.Channels /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{QueryResult{BaseItemDto}}.</returns> Task<QueryResult<BaseItemDto>> GetChannelItems(ChannelItemQuery query, CancellationToken cancellationToken); + + /// <summary> + /// Gets the channel item media sources. + /// </summary> + /// <param name="id">The identifier.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task{IEnumerable{ChannelMediaInfo}}.</returns> + Task<IEnumerable<ChannelMediaInfo>> GetChannelItemMediaSources(string id, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/Channels/IChannelMediaItem.cs b/MediaBrowser.Controller/Channels/IChannelMediaItem.cs index 3a2c076e0..1e634027f 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<ChannelMediaInfo> 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 40b52b886..dca645a75 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -10,16 +10,18 @@ namespace MediaBrowser.Controller.Entities.Audio /// <summary> /// Class Audio /// </summary> - public class Audio : BaseItem, IHasMediaStreams, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<SongInfo> + public class Audio : BaseItem, IHasMediaStreams, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<SongInfo>, IHasTags { public string FormatName { get; set; } public long? Size { get; set; } public string Container { get; set; } public int? TotalBitrate { get; set; } + public List<string> Tags { get; set; } public Audio() { Artists = new List<string>(); + Tags = new List<string>(); } /// <summary> diff --git a/MediaBrowser.Controller/Session/ISessionController.cs b/MediaBrowser.Controller/Session/ISessionController.cs index 5f07b9ff8..d6dd7698e 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 /// <summary> /// Sends the restart required message. /// </summary> + /// <param name="info">The information.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task.</returns> - Task SendRestartRequiredNotification(CancellationToken cancellationToken); + Task SendRestartRequiredNotification(SystemInfo info, CancellationToken cancellationToken); /// <summary> /// Sends the user data change info. |
