2014-03-11 19:11:01 -07:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using System.Collections.Generic;
|
2014-03-09 15:14:44 -07: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>
|
|
|
|
|
/// Gets the home page URL.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The home page URL.</value>
|
|
|
|
|
string HomePageUrl { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the capabilities.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>ChannelCapabilities.</returns>
|
|
|
|
|
ChannelCapabilities GetCapabilities();
|
|
|
|
|
|
2014-03-17 18:45:41 -07: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 15:14:44 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Searches the specified search term.
|
|
|
|
|
/// </summary>
|
2014-03-17 18:45:41 -07:00
|
|
|
|
/// <param name="searchInfo">The search information.</param>
|
2014-03-11 19:11:01 -07:00
|
|
|
|
/// <param name="user">The user.</param>
|
2014-03-09 15:14:44 -07:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
|
2014-03-17 18:45:41 -07:00
|
|
|
|
Task<IEnumerable<ChannelItemInfo>> Search(ChannelSearchInfo searchInfo, User user, CancellationToken cancellationToken);
|
2014-03-11 19:11:01 -07:00
|
|
|
|
|
2014-03-09 15:14:44 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the channel items.
|
|
|
|
|
/// </summary>
|
2014-03-11 19:11:01 -07:00
|
|
|
|
/// <param name="user">The user.</param>
|
2014-03-09 15:14:44 -07:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{ChannelItem}}.</returns>
|
2014-03-11 19:11:01 -07:00
|
|
|
|
Task<IEnumerable<ChannelItemInfo>> GetChannelItems(User user, CancellationToken cancellationToken);
|
2014-03-09 15:14:44 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the channel items.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="categoryId">The category identifier.</param>
|
2014-03-11 19:11:01 -07:00
|
|
|
|
/// <param name="user">The user.</param>
|
2014-03-09 15:14:44 -07:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{ChannelItem}}.</returns>
|
2014-03-11 19:11:01 -07:00
|
|
|
|
Task<IEnumerable<ChannelItemInfo>> GetChannelItems(string categoryId, User user, CancellationToken cancellationToken);
|
2014-03-09 15:14:44 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class ChannelCapabilities
|
|
|
|
|
{
|
|
|
|
|
public bool CanSearch { get; set; }
|
|
|
|
|
}
|
2014-03-17 18:45:41 -07:00
|
|
|
|
|
|
|
|
|
public class ChannelSearchInfo
|
|
|
|
|
{
|
|
|
|
|
public string SearchTerm { get; set; }
|
|
|
|
|
}
|
2014-03-09 15:14:44 -07:00
|
|
|
|
}
|