From f271e358a195c8bb3e931e22ca813265c7bc1f05 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 6 Jun 2014 13:14:02 -0400 Subject: update channels --- .../Channels/ChannelItemResult.cs | 5 +-- .../Channels/ChannelParentalRating.cs | 15 ++++++++ .../Channels/ChannelSearchInfo.cs | 2 ++ MediaBrowser.Controller/Channels/IChannel.cs | 41 +++++----------------- MediaBrowser.Controller/Channels/IHasCacheKey.cs | 13 +++++++ .../Channels/IIndexableChannel.cs | 16 +++++++++ .../Channels/IRequiresMediaInfoCallback.cs | 17 +++++++++ .../Channels/ISearchableChannel.cs | 17 +++++++++ .../Channels/InternalAllChannelMediaQuery.cs | 8 +++++ .../Channels/InternalChannelFeatures.cs | 12 ------- .../Channels/InternalChannelItemQuery.cs | 10 ++---- 11 files changed, 100 insertions(+), 56 deletions(-) create mode 100644 MediaBrowser.Controller/Channels/ChannelParentalRating.cs create mode 100644 MediaBrowser.Controller/Channels/IHasCacheKey.cs create mode 100644 MediaBrowser.Controller/Channels/IIndexableChannel.cs create mode 100644 MediaBrowser.Controller/Channels/IRequiresMediaInfoCallback.cs create mode 100644 MediaBrowser.Controller/Channels/ISearchableChannel.cs create mode 100644 MediaBrowser.Controller/Channels/InternalAllChannelMediaQuery.cs (limited to 'MediaBrowser.Controller/Channels') diff --git a/MediaBrowser.Controller/Channels/ChannelItemResult.cs b/MediaBrowser.Controller/Channels/ChannelItemResult.cs index 15f0a34a0c..3ec5b7c24d 100644 --- a/MediaBrowser.Controller/Channels/ChannelItemResult.cs +++ b/MediaBrowser.Controller/Channels/ChannelItemResult.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace MediaBrowser.Controller.Channels { @@ -7,8 +6,6 @@ namespace MediaBrowser.Controller.Channels { public List Items { get; set; } - public TimeSpan CacheLength { get; set; } - public int? TotalRecordCount { get; set; } } } \ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/ChannelParentalRating.cs b/MediaBrowser.Controller/Channels/ChannelParentalRating.cs new file mode 100644 index 0000000000..d9cc521b38 --- /dev/null +++ b/MediaBrowser.Controller/Channels/ChannelParentalRating.cs @@ -0,0 +1,15 @@ +namespace MediaBrowser.Controller.Channels +{ + public enum ChannelParentalRating + { + GeneralAudience = 0, + + UsPG = 1, + + UsPG13 = 2, + + UsR = 3, + + Adult = 4 + } +} \ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/ChannelSearchInfo.cs b/MediaBrowser.Controller/Channels/ChannelSearchInfo.cs index bf7461327c..a291d6e27f 100644 --- a/MediaBrowser.Controller/Channels/ChannelSearchInfo.cs +++ b/MediaBrowser.Controller/Channels/ChannelSearchInfo.cs @@ -3,5 +3,7 @@ public class ChannelSearchInfo { public string SearchTerm { get; set; } + + public string UserId { get; set; } } } \ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/IChannel.cs b/MediaBrowser.Controller/Channels/IChannel.cs index 1d7c298fab..cce341e438 100644 --- a/MediaBrowser.Controller/Channels/IChannel.cs +++ b/MediaBrowser.Controller/Channels/IChannel.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Providers; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; using System.Collections.Generic; using System.Threading; @@ -27,6 +26,12 @@ namespace MediaBrowser.Controller.Channels /// The home page URL. string HomePageUrl { get; } + /// + /// Gets the parental rating. + /// + /// The parental rating. + ChannelParentalRating ParentalRating { get; } + /// /// Gets the channel information. /// @@ -36,26 +41,9 @@ namespace MediaBrowser.Controller.Channels /// /// Determines whether [is enabled for] [the specified user]. /// - /// The user. + /// The user identifier. /// true if [is enabled for] [the specified user]; otherwise, false. - bool IsEnabledFor(User user); - - /// - /// Searches the specified search term. - /// - /// The search information. - /// The user. - /// The cancellation token. - /// Task{IEnumerable{ChannelItemInfo}}. - Task> Search(ChannelSearchInfo searchInfo, User user, CancellationToken cancellationToken); - - /// - /// Gets all media. - /// - /// The query. - /// The cancellation token. - /// Task{ChannelItemResult}. - Task GetAllMedia(InternalAllChannelMediaQuery query, CancellationToken cancellationToken); + bool IsEnabledFor(string userId); /// /// Gets the channel items. @@ -79,15 +67,4 @@ 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/IHasCacheKey.cs b/MediaBrowser.Controller/Channels/IHasCacheKey.cs new file mode 100644 index 0000000000..6376d2f914 --- /dev/null +++ b/MediaBrowser.Controller/Channels/IHasCacheKey.cs @@ -0,0 +1,13 @@ + +namespace MediaBrowser.Controller.Channels +{ + public interface IHasCacheKey + { + /// + /// Gets the cache key. + /// + /// The user identifier. + /// System.String. + string GetCacheKey(string userId); + } +} diff --git a/MediaBrowser.Controller/Channels/IIndexableChannel.cs b/MediaBrowser.Controller/Channels/IIndexableChannel.cs new file mode 100644 index 0000000000..0b52585e8f --- /dev/null +++ b/MediaBrowser.Controller/Channels/IIndexableChannel.cs @@ -0,0 +1,16 @@ +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.Channels +{ + public interface IIndexableChannel + { + /// + /// Gets all media. + /// + /// The query. + /// The cancellation token. + /// Task{ChannelItemResult}. + Task GetAllMedia(InternalAllChannelMediaQuery query, CancellationToken cancellationToken); + } +} \ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/IRequiresMediaInfoCallback.cs b/MediaBrowser.Controller/Channels/IRequiresMediaInfoCallback.cs new file mode 100644 index 0000000000..b4b6be9baf --- /dev/null +++ b/MediaBrowser.Controller/Channels/IRequiresMediaInfoCallback.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.Channels +{ + public interface IRequiresMediaInfoCallback + { + /// + /// Gets the channel item media information. + /// + /// The identifier. + /// The cancellation token. + /// Task{IEnumerable{ChannelMediaInfo}}. + Task> GetChannelItemMediaInfo(string id, CancellationToken cancellationToken); + } +} \ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/ISearchableChannel.cs b/MediaBrowser.Controller/Channels/ISearchableChannel.cs new file mode 100644 index 0000000000..c5fb3a4f19 --- /dev/null +++ b/MediaBrowser.Controller/Channels/ISearchableChannel.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.Channels +{ + public interface ISearchableChannel + { + /// + /// Searches the specified search term. + /// + /// The search information. + /// The cancellation token. + /// Task{IEnumerable{ChannelItemInfo}}. + Task> Search(ChannelSearchInfo searchInfo, CancellationToken cancellationToken); + } +} \ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/InternalAllChannelMediaQuery.cs b/MediaBrowser.Controller/Channels/InternalAllChannelMediaQuery.cs new file mode 100644 index 0000000000..de99c16c48 --- /dev/null +++ b/MediaBrowser.Controller/Channels/InternalAllChannelMediaQuery.cs @@ -0,0 +1,8 @@ + +namespace MediaBrowser.Controller.Channels +{ + public class InternalAllChannelMediaQuery + { + public string UserId { get; set; } + } +} \ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs b/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs index 44da646d04..814c565779 100644 --- a/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs +++ b/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs @@ -5,18 +5,6 @@ namespace MediaBrowser.Controller.Channels { public class InternalChannelFeatures { - /// - /// Gets or sets a value indicating whether this instance can search. - /// - /// true if this instance can search; otherwise, false. - public bool CanSearch { get; set; } - - /// - /// Gets or sets a value indicating whether this instance can get all media. - /// - /// true if this instance can get all media; otherwise, false. - public bool CanGetAllMedia { get; set; } - /// /// Gets or sets the media types. /// diff --git a/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs b/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs index dceced14c4..82ef6b9462 100644 --- a/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs +++ b/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Channels; +using MediaBrowser.Model.Channels; namespace MediaBrowser.Controller.Channels { @@ -7,7 +6,7 @@ namespace MediaBrowser.Controller.Channels { public string FolderId { get; set; } - public User User { get; set; } + public string UserId { get; set; } public int? StartIndex { get; set; } @@ -17,9 +16,4 @@ namespace MediaBrowser.Controller.Channels public bool SortDescending { get; set; } } - - public class InternalAllChannelMediaQuery - { - public User User { get; set; } - } } \ No newline at end of file -- cgit v1.2.3