aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Channels/IChannel.cs
blob: edb2347c05c28b289516e456922a4d0b20f86f18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System.Collections.Generic;
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();

        /// <summary>
        /// Searches the specified search term.
        /// </summary>
        /// <param name="searchTerm">The search term.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
        Task<IEnumerable<ChannelItemInfo>> Search(string searchTerm, CancellationToken cancellationToken);
        
        /// <summary>
        /// Gets the channel items.
        /// </summary>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>Task{IEnumerable{ChannelItem}}.</returns>
        Task<IEnumerable<ChannelItemInfo>> GetChannelItems(CancellationToken cancellationToken);

        /// <summary>
        /// Gets the channel items.
        /// </summary>
        /// <param name="categoryId">The category identifier.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>Task{IEnumerable{ChannelItem}}.</returns>
        Task<IEnumerable<ChannelItemInfo>> GetChannelItems(string categoryId, CancellationToken cancellationToken);
    }

    public class ChannelCapabilities
    {
        public bool CanSearch { get; set; }

        public bool CanBeIndexed { get; set; }
    }
}