2014-03-12 03:11:01 +01:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2014-03-18 18:05:57 +01:00
|
|
|
|
using MediaBrowser.Controller.Providers;
|
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
using System;
|
2014-03-12 03:11:01 +01:00
|
|
|
|
using System.Collections.Generic;
|
2014-03-09 23:14:44 +01:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Channels
|
|
|
|
|
{
|
|
|
|
|
public interface IChannel
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The name.</value>
|
|
|
|
|
string Name { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-05-03 06:20:04 +02:00
|
|
|
|
/// Gets the channel information.
|
2014-03-09 23:14:44 +01:00
|
|
|
|
/// </summary>
|
2014-05-03 06:20:04 +02:00
|
|
|
|
/// <returns>ChannelInfo.</returns>
|
|
|
|
|
ChannelInfo GetChannelInfo();
|
2014-03-09 23:14:44 +01:00
|
|
|
|
|
2014-03-18 02:45:41 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determines whether [is enabled for] [the specified user].
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="user">The user.</param>
|
|
|
|
|
/// <returns><c>true</c> if [is enabled for] [the specified user]; otherwise, <c>false</c>.</returns>
|
|
|
|
|
bool IsEnabledFor(User user);
|
|
|
|
|
|
2014-03-09 23:14:44 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Searches the specified search term.
|
|
|
|
|
/// </summary>
|
2014-03-18 02:45:41 +01:00
|
|
|
|
/// <param name="searchInfo">The search information.</param>
|
2014-03-12 03:11:01 +01:00
|
|
|
|
/// <param name="user">The user.</param>
|
2014-03-09 23:14:44 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
|
2014-03-18 02:45:41 +01:00
|
|
|
|
Task<IEnumerable<ChannelItemInfo>> Search(ChannelSearchInfo searchInfo, User user, CancellationToken cancellationToken);
|
2014-03-12 03:11:01 +01:00
|
|
|
|
|
2014-03-09 23:14:44 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the channel items.
|
|
|
|
|
/// </summary>
|
2014-03-18 18:05:57 +01:00
|
|
|
|
/// <param name="query">The query.</param>
|
2014-03-09 23:14:44 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{ChannelItem}}.</returns>
|
2014-03-18 18:05:57 +01:00
|
|
|
|
Task<ChannelItemResult> GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken);
|
2014-03-09 23:14:44 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-03-18 18:05:57 +01:00
|
|
|
|
/// Gets the channel image.
|
2014-03-09 23:14:44 +01:00
|
|
|
|
/// </summary>
|
2014-03-18 18:05:57 +01:00
|
|
|
|
/// <param name="type">The type.</param>
|
2014-03-09 23:14:44 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2014-03-18 18:05:57 +01:00
|
|
|
|
/// <returns>Task{DynamicImageInfo}.</returns>
|
|
|
|
|
Task<DynamicImageResponse> GetChannelImage(ImageType type, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the supported channel images.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>IEnumerable{ImageType}.</returns>
|
|
|
|
|
IEnumerable<ImageType> GetSupportedChannelImages();
|
2014-03-09 23:14:44 +01:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-04 01:38:23 +02:00
|
|
|
|
public interface IChannelFactory
|
|
|
|
|
{
|
|
|
|
|
IEnumerable<IChannel> GetChannels();
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-03 06:20:04 +02:00
|
|
|
|
public class ChannelInfo
|
2014-03-09 23:14:44 +01:00
|
|
|
|
{
|
2014-05-03 06:20:04 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the home page URL.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The home page URL.</value>
|
|
|
|
|
public string HomePageUrl { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <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>
|
2014-03-09 23:14:44 +01:00
|
|
|
|
public bool CanSearch { get; set; }
|
2014-05-03 06:20:04 +02:00
|
|
|
|
|
|
|
|
|
public List<ChannelMediaType> MediaTypes { get; set; }
|
|
|
|
|
|
|
|
|
|
public List<ChannelMediaContentType> ContentTypes { get; set; }
|
|
|
|
|
|
|
|
|
|
public ChannelInfo()
|
|
|
|
|
{
|
|
|
|
|
MediaTypes = new List<ChannelMediaType>();
|
|
|
|
|
ContentTypes = new List<ChannelMediaContentType>();
|
|
|
|
|
}
|
2014-03-09 23:14:44 +01:00
|
|
|
|
}
|
2014-03-18 02:45:41 +01:00
|
|
|
|
|
|
|
|
|
public class ChannelSearchInfo
|
|
|
|
|
{
|
|
|
|
|
public string SearchTerm { get; set; }
|
|
|
|
|
}
|
2014-03-18 18:05:57 +01:00
|
|
|
|
|
|
|
|
|
public class InternalChannelItemQuery
|
|
|
|
|
{
|
|
|
|
|
public string CategoryId { get; set; }
|
|
|
|
|
|
|
|
|
|
public User User { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class ChannelItemResult
|
|
|
|
|
{
|
|
|
|
|
public List<ChannelItemInfo> Items { get; set; }
|
|
|
|
|
|
|
|
|
|
public TimeSpan CacheLength { get; set; }
|
|
|
|
|
}
|
2014-03-09 23:14:44 +01:00
|
|
|
|
}
|