From 53749f077bedc84323ac13694c7f0963a65d1f06 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 17 Mar 2014 21:45:41 -0400 Subject: progress on channels api --- MediaBrowser.Controller/Channels/Channel.cs | 9 +++++++ .../Channels/ChannelAudioItem.cs | 17 +++++++++++++ .../Channels/ChannelItemInfo.cs | 9 +++++-- .../Channels/ChannelVideoItem.cs | 17 +++++++++++++ MediaBrowser.Controller/Channels/IChannel.cs | 16 +++++++++++-- MediaBrowser.Controller/Channels/IChannelItem.cs | 17 +++++++++++++ .../Channels/IChannelManager.cs | 28 +++++++++++++++++++--- .../Dlna/DeviceIdentification.cs | 15 ++++++++++++ MediaBrowser.Controller/Dlna/DeviceProfile.cs | 22 +++++++++++++++++ MediaBrowser.Controller/Dlna/DirectPlayProfile.cs | 1 + MediaBrowser.Controller/Dlna/TranscodingProfile.cs | 23 +++++++++++++++++- MediaBrowser.Controller/LiveTv/LiveTvChannel.cs | 2 +- .../MediaBrowser.Controller.csproj | 4 ++++ 13 files changed, 171 insertions(+), 9 deletions(-) create mode 100644 MediaBrowser.Controller/Channels/Channel.cs create mode 100644 MediaBrowser.Controller/Channels/ChannelAudioItem.cs create mode 100644 MediaBrowser.Controller/Channels/ChannelVideoItem.cs create mode 100644 MediaBrowser.Controller/Channels/IChannelItem.cs (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Channels/Channel.cs b/MediaBrowser.Controller/Channels/Channel.cs new file mode 100644 index 0000000000..c9a70f2bc2 --- /dev/null +++ b/MediaBrowser.Controller/Channels/Channel.cs @@ -0,0 +1,9 @@ +using MediaBrowser.Controller.Entities; + +namespace MediaBrowser.Controller.Channels +{ + public class Channel : BaseItem + { + public string OriginalChannelName { get; set; } + } +} diff --git a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs new file mode 100644 index 0000000000..269a954560 --- /dev/null +++ b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs @@ -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; } + } +} diff --git a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs index 496fbfbf45..f80ad89110 100644 --- a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs +++ b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs @@ -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 ProviderIds { get; set; } public ChannelItemInfo() { Genres = new List(); People = new List(); + ProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); } } diff --git a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs new file mode 100644 index 0000000000..baa4c2a17e --- /dev/null +++ b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs @@ -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; } + } +} diff --git a/MediaBrowser.Controller/Channels/IChannel.cs b/MediaBrowser.Controller/Channels/IChannel.cs index ba1bd40832..956eb67e8a 100644 --- a/MediaBrowser.Controller/Channels/IChannel.cs +++ b/MediaBrowser.Controller/Channels/IChannel.cs @@ -25,14 +25,21 @@ namespace MediaBrowser.Controller.Channels /// ChannelCapabilities. ChannelCapabilities GetCapabilities(); + /// + /// Determines whether [is enabled for] [the specified user]. + /// + /// The user. + /// true if [is enabled for] [the specified user]; otherwise, false. + bool IsEnabledFor(User user); + /// /// Searches the specified search term. /// - /// The search term. + /// The search information. /// The user. /// The cancellation token. /// Task{IEnumerable{ChannelItemInfo}}. - Task> Search(string searchTerm, User user, CancellationToken cancellationToken); + Task> Search(ChannelSearchInfo searchInfo, User user, CancellationToken cancellationToken); /// /// 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; } + } } diff --git a/MediaBrowser.Controller/Channels/IChannelItem.cs b/MediaBrowser.Controller/Channels/IChannelItem.cs new file mode 100644 index 0000000000..ffef532a9c --- /dev/null +++ b/MediaBrowser.Controller/Channels/IChannelItem.cs @@ -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; } + } +} diff --git a/MediaBrowser.Controller/Channels/IChannelManager.cs b/MediaBrowser.Controller/Channels/IChannelManager.cs index 561ab555bd..b34e77415f 100644 --- a/MediaBrowser.Controller/Channels/IChannelManager.cs +++ b/MediaBrowser.Controller/Channels/IChannelManager.cs @@ -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 { + /// + /// Adds the parts. + /// + /// The channels. + void AddParts(IEnumerable channels); + + /// + /// Gets the channels. + /// + /// The query. + /// The cancellation token. + /// Task{QueryResult{BaseItemDto}}. + Task> GetChannels(ChannelQuery query, CancellationToken cancellationToken); + + /// + /// Gets the channel items. + /// + /// The query. + /// The cancellation token. + /// Task{QueryResult{BaseItemDto}}. + Task> GetChannelItems(ChannelItemQuery query, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/Dlna/DeviceIdentification.cs b/MediaBrowser.Controller/Dlna/DeviceIdentification.cs index a3a6155160..4ccba11063 100644 --- a/MediaBrowser.Controller/Dlna/DeviceIdentification.cs +++ b/MediaBrowser.Controller/Dlna/DeviceIdentification.cs @@ -25,6 +25,21 @@ namespace MediaBrowser.Controller.Dlna /// The name of the model. public string ModelName { get; set; } /// + /// Gets or sets the model description. + /// + /// The model description. + public string ModelDescription { get; set; } + /// + /// Gets or sets the device description. + /// + /// The device description. + public string DeviceDescription { get; set; } + /// + /// Gets or sets the model URL. + /// + /// The model URL. + public string ModelUrl { get; set; } + /// /// Gets or sets the manufacturer. /// /// diff --git a/MediaBrowser.Controller/Dlna/DeviceProfile.cs b/MediaBrowser.Controller/Dlna/DeviceProfile.cs index 119cfffd74..ca5929d135 100644 --- a/MediaBrowser.Controller/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Controller/Dlna/DeviceProfile.cs @@ -33,6 +33,28 @@ namespace MediaBrowser.Controller.Dlna /// The identification. 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; } + /// + /// Controls the content of the X_DLNADOC element in the urn:schemas-dlna-org:device-1-0 namespace. + /// + public string XDlnaDoc { get; set; } + /// + /// Controls the content of the X_DLNACAP element in the urn:schemas-dlna-org:device-1-0 namespace. + /// + public string XDlnaCap { get; set; } + /// + /// Controls the content of the aggregationFlags element in the urn:schemas-sonycom:av. + /// + public string SonyAggregationFlags { get; set; } + + public string ProtocolInfo { get; set; } + public DeviceProfile() { DirectPlayProfiles = new DirectPlayProfile[] { }; diff --git a/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs b/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs index 8c35b52a81..68e25e2f7b 100644 --- a/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs +++ b/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs @@ -53,6 +53,7 @@ namespace MediaBrowser.Controller.Dlna } } + public string OrgPn { get; set; } public string MimeType { get; set; } public DlnaProfileType Type { get; set; } diff --git a/MediaBrowser.Controller/Dlna/TranscodingProfile.cs b/MediaBrowser.Controller/Dlna/TranscodingProfile.cs index abc8868fb9..3b0a513d13 100644 --- a/MediaBrowser.Controller/Dlna/TranscodingProfile.cs +++ b/MediaBrowser.Controller/Dlna/TranscodingProfile.cs @@ -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 Settings { get; set; } + + public TranscodingProfile() + { + Settings = new List(); + } + } + + public class TranscodingSetting + { + public TranscodingSettingType Name { get; set; } + public string Value { get; set; } + } + + public enum TranscodingSettingType + { + Profile } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index 3e6832123e..5b78b67898 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -107,7 +107,7 @@ namespace MediaBrowser.Controller.LiveTv public override string GetClientTypeName() { - return "Channel"; + return "TvChannel"; } public IEnumerable GetTaggedItems(IEnumerable inputItems) diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 2dc444ea93..87fdc66f93 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -71,6 +71,10 @@ + + + + -- cgit v1.2.3