progress on channels api

This commit is contained in:
Luke Pulverenti
2014-03-17 21:45:41 -04:00
parent 3d70929708
commit 53749f077b
31 changed files with 765 additions and 55 deletions

View File

@@ -0,0 +1,9 @@
using MediaBrowser.Controller.Entities;
namespace MediaBrowser.Controller.Channels
{
public class Channel : BaseItem
{
public string OriginalChannelName { get; set; }
}
}

View 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; }
}
}

View File

@@ -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);
}
}

View 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; }
}
}

View File

@@ -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; }
}
}

View 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; }
}
}

View File

@@ -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);
}
}

View File

@@ -25,6 +25,21 @@ namespace MediaBrowser.Controller.Dlna
/// <value>The name of the model.</value>
public string ModelName { get; set; }
/// <summary>
/// Gets or sets the model description.
/// </summary>
/// <value>The model description.</value>
public string ModelDescription { get; set; }
/// <summary>
/// Gets or sets the device description.
/// </summary>
/// <value>The device description.</value>
public string DeviceDescription { get; set; }
/// <summary>
/// Gets or sets the model URL.
/// </summary>
/// <value>The model URL.</value>
public string ModelUrl { get; set; }
/// <summary>
/// Gets or sets the manufacturer.
/// </summary>
/// <value>

View File

@@ -33,6 +33,28 @@ namespace MediaBrowser.Controller.Dlna
/// <value>The identification.</value>
public DeviceIdentification Identification { get; set; }
public string FriendlyName { get; set; }
public string Manufacturer { get; set; }
public string ManufacturerUrl { get; set; }
public string ModelName { get; set; }
public string ModelDescription { get; set; }
public string ModelNumber { get; set; }
public string ModelUrl { get; set; }
/// <summary>
/// Controls the content of the X_DLNADOC element in the urn:schemas-dlna-org:device-1-0 namespace.
/// </summary>
public string XDlnaDoc { get; set; }
/// <summary>
/// Controls the content of the X_DLNACAP element in the urn:schemas-dlna-org:device-1-0 namespace.
/// </summary>
public string XDlnaCap { get; set; }
/// <summary>
/// Controls the content of the aggregationFlags element in the urn:schemas-sonycom:av.
/// </summary>
public string SonyAggregationFlags { get; set; }
public string ProtocolInfo { get; set; }
public DeviceProfile()
{
DirectPlayProfiles = new DirectPlayProfile[] { };

View File

@@ -53,6 +53,7 @@ namespace MediaBrowser.Controller.Dlna
}
}
public string OrgPn { get; set; }
public string MimeType { get; set; }
public DlnaProfileType Type { get; set; }

View File

@@ -1,4 +1,5 @@

using System.Collections.Generic;
namespace MediaBrowser.Controller.Dlna
{
public class TranscodingProfile
@@ -9,8 +10,28 @@ namespace MediaBrowser.Controller.Dlna
public string MimeType { get; set; }
public string OrgPn { get; set; }
public string VideoCodec { get; set; }
public string AudioCodec { get; set; }
public List<TranscodingSetting> Settings { get; set; }
public TranscodingProfile()
{
Settings = new List<TranscodingSetting>();
}
}
public class TranscodingSetting
{
public TranscodingSettingType Name { get; set; }
public string Value { get; set; }
}
public enum TranscodingSettingType
{
Profile
}
}

View File

@@ -107,7 +107,7 @@ namespace MediaBrowser.Controller.LiveTv
public override string GetClientTypeName()
{
return "Channel";
return "TvChannel";
}
public IEnumerable<BaseItem> GetTaggedItems(IEnumerable<BaseItem> inputItems)

View File

@@ -71,6 +71,10 @@
<Compile Include="Channels\ChannelItemInfo.cs" />
<Compile Include="Channels\IChannel.cs" />
<Compile Include="Channels\IChannelManager.cs" />
<Compile Include="Channels\IChannelItem.cs" />
<Compile Include="Channels\ChannelAudioItem.cs" />
<Compile Include="Channels\ChannelVideoItem.cs" />
<Compile Include="Channels\Channel.cs" />
<Compile Include="Collections\CollectionCreationOptions.cs" />
<Compile Include="Collections\ICollectionManager.cs" />
<Compile Include="Dlna\DeviceIdentification.cs" />