diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-06 13:14:02 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-06 13:14:02 -0400 |
| commit | f271e358a195c8bb3e931e22ca813265c7bc1f05 (patch) | |
| tree | 5a126dee9cd8cdd958a2a0c32386361c0ec02bf6 /MediaBrowser.Controller | |
| parent | 6120286bfdc274b8cb388b1d67bf616b6c2d09d0 (diff) | |
update channels
Diffstat (limited to 'MediaBrowser.Controller')
12 files changed, 106 insertions, 56 deletions
diff --git a/MediaBrowser.Controller/Channels/ChannelItemResult.cs b/MediaBrowser.Controller/Channels/ChannelItemResult.cs index 15f0a34a0..3ec5b7c24 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<ChannelItemInfo> 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 000000000..d9cc521b3 --- /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 bf7461327..a291d6e27 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 1d7c298fa..cce341e43 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; @@ -28,6 +27,12 @@ namespace MediaBrowser.Controller.Channels string HomePageUrl { get; } /// <summary> + /// Gets the parental rating. + /// </summary> + /// <value>The parental rating.</value> + ChannelParentalRating ParentalRating { get; } + + /// <summary> /// Gets the channel information. /// </summary> /// <returns>ChannelFeatures.</returns> @@ -36,26 +41,9 @@ namespace MediaBrowser.Controller.Channels /// <summary> /// Determines whether [is enabled for] [the specified user]. /// </summary> - /// <param name="user">The user.</param> + /// <param name="userId">The user identifier.</param> /// <returns><c>true</c> if [is enabled for] [the specified user]; otherwise, <c>false</c>.</returns> - bool IsEnabledFor(User user); - - /// <summary> - /// Searches the specified search term. - /// </summary> - /// <param name="searchInfo">The search information.</param> - /// <param name="user">The user.</param> - /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns> - Task<IEnumerable<ChannelItemInfo>> Search(ChannelSearchInfo searchInfo, User user, CancellationToken cancellationToken); - - /// <summary> - /// Gets all media. - /// </summary> - /// <param name="query">The query.</param> - /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>Task{ChannelItemResult}.</returns> - Task<ChannelItemResult> GetAllMedia(InternalAllChannelMediaQuery query, CancellationToken cancellationToken); + bool IsEnabledFor(string userId); /// <summary> /// Gets the channel items. @@ -79,15 +67,4 @@ 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/IHasCacheKey.cs b/MediaBrowser.Controller/Channels/IHasCacheKey.cs new file mode 100644 index 000000000..6376d2f91 --- /dev/null +++ b/MediaBrowser.Controller/Channels/IHasCacheKey.cs @@ -0,0 +1,13 @@ + +namespace MediaBrowser.Controller.Channels +{ + public interface IHasCacheKey + { + /// <summary> + /// Gets the cache key. + /// </summary> + /// <param name="userId">The user identifier.</param> + /// <returns>System.String.</returns> + string GetCacheKey(string userId); + } +} diff --git a/MediaBrowser.Controller/Channels/IIndexableChannel.cs b/MediaBrowser.Controller/Channels/IIndexableChannel.cs new file mode 100644 index 000000000..0b52585e8 --- /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 + { + /// <summary> + /// Gets all media. + /// </summary> + /// <param name="query">The query.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task{ChannelItemResult}.</returns> + Task<ChannelItemResult> 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 000000000..b4b6be9ba --- /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 + { + /// <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); + } +}
\ 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 000000000..c5fb3a4f1 --- /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 + { + /// <summary> + /// Searches the specified search term. + /// </summary> + /// <param name="searchInfo">The search information.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns> + Task<IEnumerable<ChannelItemInfo>> 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 000000000..de99c16c4 --- /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 44da646d0..814c56577 100644 --- a/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs +++ b/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs @@ -6,18 +6,6 @@ namespace MediaBrowser.Controller.Channels public class InternalChannelFeatures { /// <summary> - /// Gets or sets a value indicating whether this instance can search. - /// </summary> - /// <value><c>true</c> if this instance can search; otherwise, <c>false</c>.</value> - public bool CanSearch { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance can get all media. - /// </summary> - /// <value><c>true</c> if this instance can get all media; otherwise, <c>false</c>.</value> - public bool CanGetAllMedia { get; set; } - - /// <summary> /// Gets or sets the media types. /// </summary> /// <value>The media types.</value> diff --git a/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs b/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs index dceced14c..82ef6b946 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 diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 38db9e881..5d8d62eb9 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -73,6 +73,7 @@ <Compile Include="Channels\ChannelItemResult.cs" /> <Compile Include="Channels\ChannelItemType.cs" /> <Compile Include="Channels\ChannelMediaInfo.cs" /> + <Compile Include="Channels\ChannelParentalRating.cs" /> <Compile Include="Channels\ChannelSearchInfo.cs" /> <Compile Include="Channels\IChannel.cs" /> <Compile Include="Channels\IChannelFactory.cs" /> @@ -82,8 +83,13 @@ <Compile Include="Channels\ChannelVideoItem.cs" /> <Compile Include="Channels\Channel.cs" /> <Compile Include="Channels\IChannelMediaItem.cs" /> + <Compile Include="Channels\IHasCacheKey.cs" /> + <Compile Include="Channels\IIndexableChannel.cs" /> + <Compile Include="Channels\InternalAllChannelMediaQuery.cs" /> <Compile Include="Channels\InternalChannelFeatures.cs" /> <Compile Include="Channels\InternalChannelItemQuery.cs" /> + <Compile Include="Channels\IRequiresMediaInfoCallback.cs" /> + <Compile Include="Channels\ISearchableChannel.cs" /> <Compile Include="Chapters\ChapterSearchRequest.cs" /> <Compile Include="Chapters\IChapterProvider.cs" /> <Compile Include="Chapters\ChapterResponse.cs" /> |
