mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-18 20:24:20 +01:00
progress on channels api
This commit is contained in:
9
MediaBrowser.Controller/Channels/Channel.cs
Normal file
9
MediaBrowser.Controller/Channels/Channel.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
public class Channel : BaseItem
|
||||
{
|
||||
public string OriginalChannelName { get; set; }
|
||||
}
|
||||
}
|
||||
17
MediaBrowser.Controller/Channels/ChannelAudioItem.cs
Normal file
17
MediaBrowser.Controller/Channels/ChannelAudioItem.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
|
||||
namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
public class ChannelAudioItem : Audio, IChannelItem
|
||||
{
|
||||
public string ExternalId { get; set; }
|
||||
|
||||
public ChannelItemType ChannelItemType { get; set; }
|
||||
|
||||
public bool IsInfiniteStream { get; set; }
|
||||
|
||||
public ChannelMediaContentType ContentType { get; set; }
|
||||
|
||||
public string OriginalImageUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
public class ChannelItemInfo
|
||||
public class ChannelItemInfo : IHasProviderIds
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -23,18 +25,21 @@ namespace MediaBrowser.Controller.Channels
|
||||
|
||||
public long? RunTimeTicks { get; set; }
|
||||
|
||||
public bool IsInfinite { get; set; }
|
||||
public bool IsInfiniteStream { get; set; }
|
||||
|
||||
public string ImageUrl { get; set; }
|
||||
|
||||
public ChannelMediaType MediaType { get; set; }
|
||||
|
||||
public ChannelMediaContentType ContentType { get; set; }
|
||||
|
||||
public Dictionary<string, string> ProviderIds { get; set; }
|
||||
|
||||
public ChannelItemInfo()
|
||||
{
|
||||
Genres = new List<string>();
|
||||
People = new List<PersonInfo>();
|
||||
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
17
MediaBrowser.Controller/Channels/ChannelVideoItem.cs
Normal file
17
MediaBrowser.Controller/Channels/ChannelVideoItem.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
public class ChannelVideoItem : Video, IChannelItem
|
||||
{
|
||||
public string ExternalId { get; set; }
|
||||
|
||||
public ChannelItemType ChannelItemType { get; set; }
|
||||
|
||||
public bool IsInfiniteStream { get; set; }
|
||||
|
||||
public ChannelMediaContentType ContentType { get; set; }
|
||||
|
||||
public string OriginalImageUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -25,14 +25,21 @@ namespace MediaBrowser.Controller.Channels
|
||||
/// <returns>ChannelCapabilities.</returns>
|
||||
ChannelCapabilities GetCapabilities();
|
||||
|
||||
/// <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);
|
||||
|
||||
/// <summary>
|
||||
/// Searches the specified search term.
|
||||
/// </summary>
|
||||
/// <param name="searchTerm">The search term.</param>
|
||||
/// <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(string searchTerm, User user, CancellationToken cancellationToken);
|
||||
Task<IEnumerable<ChannelItemInfo>> Search(ChannelSearchInfo searchInfo, User user, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the channel items.
|
||||
@@ -56,4 +63,9 @@ namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
public bool CanSearch { get; set; }
|
||||
}
|
||||
|
||||
public class ChannelSearchInfo
|
||||
{
|
||||
public string SearchTerm { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
17
MediaBrowser.Controller/Channels/IChannelItem.cs
Normal file
17
MediaBrowser.Controller/Channels/IChannelItem.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
public interface IChannelItem : IHasImages
|
||||
{
|
||||
string ExternalId { get; set; }
|
||||
|
||||
ChannelItemType ChannelItemType { get; set; }
|
||||
|
||||
bool IsInfiniteStream { get; set; }
|
||||
|
||||
ChannelMediaContentType ContentType { get; set; }
|
||||
|
||||
string OriginalImageUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,34 @@
|
||||
using System;
|
||||
using MediaBrowser.Model.Channels;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
public interface IChannelManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds the parts.
|
||||
/// </summary>
|
||||
/// <param name="channels">The channels.</param>
|
||||
void AddParts(IEnumerable<IChannel> channels);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the channels.
|
||||
/// </summary>
|
||||
/// <param name="query">The query.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{QueryResult{BaseItemDto}}.</returns>
|
||||
Task<QueryResult<BaseItemDto>> GetChannels(ChannelQuery query, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the channel items.
|
||||
/// </summary>
|
||||
/// <param name="query">The query.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{QueryResult{BaseItemDto}}.</returns>
|
||||
Task<QueryResult<BaseItemDto>> GetChannelItems(ChannelItemQuery query, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user