rename channel query objects

This commit is contained in:
Luke Pulverenti 2014-05-31 11:13:07 -04:00
parent 704571605b
commit df83adbb71
16 changed files with 58 additions and 33 deletions

View file

@ -21,7 +21,7 @@ namespace MediaBrowser.Api.LiveTv
public class GetChannels : IReturn<QueryResult<ChannelInfoDto>> public class GetChannels : IReturn<QueryResult<ChannelInfoDto>>
{ {
[ApiMember(Name = "Type", Description = "Optional filter by channel type.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "Type", Description = "Optional filter by channel type.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public ChannelType? Type { get; set; } public LiveTvChannelType? Type { get; set; }
[ApiMember(Name = "UserId", Description = "Optional filter by user and attach user data.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "UserId", Description = "Optional filter by user and attach user data.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string UserId { get; set; } public string UserId { get; set; }
@ -294,7 +294,7 @@ namespace MediaBrowser.Api.LiveTv
public object Get(GetChannels request) public object Get(GetChannels request)
{ {
var result = _liveTvManager.GetChannels(new ChannelQuery var result = _liveTvManager.GetChannels(new LiveTvChannelQuery
{ {
ChannelType = request.Type, ChannelType = request.Type,
UserId = request.UserId, UserId = request.UserId,

View file

@ -29,7 +29,7 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets or sets the type of the channel. /// Gets or sets the type of the channel.
/// </summary> /// </summary>
/// <value>The type of the channel.</value> /// <value>The type of the channel.</value>
public ChannelType ChannelType { get; set; } public LiveTvChannelType ChannelType { get; set; }
/// <summary> /// <summary>
/// Supply the image path if it can be accessed directly from the file system /// Supply the image path if it can be accessed directly from the file system

View file

@ -72,7 +72,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="query">The query.</param> /// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>IEnumerable{Channel}.</returns> /// <returns>IEnumerable{Channel}.</returns>
Task<QueryResult<ChannelInfoDto>> GetChannels(ChannelQuery query, CancellationToken cancellationToken); Task<QueryResult<ChannelInfoDto>> GetChannels(LiveTvChannelQuery query, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Gets the recording. /// Gets the recording.

View file

@ -63,7 +63,7 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets or sets the type of the channel. /// Gets or sets the type of the channel.
/// </summary> /// </summary>
/// <value>The type of the channel.</value> /// <value>The type of the channel.</value>
public ChannelType ChannelType { get; set; } public LiveTvChannelType ChannelType { get; set; }
public string ServiceName { get; set; } public string ServiceName { get; set; }
@ -101,7 +101,7 @@ namespace MediaBrowser.Controller.LiveTv
{ {
get get
{ {
return ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video; return ChannelType == LiveTvChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video;
} }
} }

View file

@ -35,7 +35,7 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets or sets the type of the channel. /// Gets or sets the type of the channel.
/// </summary> /// </summary>
/// <value>The type of the channel.</value> /// <value>The type of the channel.</value>
public ChannelType ChannelType { get; set; } public LiveTvChannelType ChannelType { get; set; }
/// <summary> /// <summary>
/// The start date of the program, in UTC. /// The start date of the program, in UTC.
@ -161,7 +161,7 @@ namespace MediaBrowser.Controller.LiveTv
{ {
get get
{ {
return ChannelType == ChannelType.TV ? Model.Entities.MediaType.Video : Model.Entities.MediaType.Audio; return ChannelType == LiveTvChannelType.TV ? Model.Entities.MediaType.Video : Model.Entities.MediaType.Audio;
} }
} }

View file

@ -26,7 +26,7 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets or sets the type of the channel. /// Gets or sets the type of the channel.
/// </summary> /// </summary>
/// <value>The type of the channel.</value> /// <value>The type of the channel.</value>
public ChannelType ChannelType { get; set; } public LiveTvChannelType ChannelType { get; set; }
/// <summary> /// <summary>
/// Name of the recording. /// Name of the recording.

View file

@ -482,18 +482,18 @@
<Compile Include="..\MediaBrowser.Model\LiveTv\ChannelInfoDto.cs"> <Compile Include="..\MediaBrowser.Model\LiveTv\ChannelInfoDto.cs">
<Link>LiveTv\ChannelInfoDto.cs</Link> <Link>LiveTv\ChannelInfoDto.cs</Link>
</Compile> </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\ChannelQuery.cs">
<Link>LiveTv\ChannelQuery.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\ChannelType.cs">
<Link>LiveTv\ChannelType.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\DayPattern.cs"> <Compile Include="..\MediaBrowser.Model\LiveTv\DayPattern.cs">
<Link>LiveTv\DayPattern.cs</Link> <Link>LiveTv\DayPattern.cs</Link>
</Compile> </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\GuideInfo.cs"> <Compile Include="..\MediaBrowser.Model\LiveTv\GuideInfo.cs">
<Link>LiveTv\GuideInfo.cs</Link> <Link>LiveTv\GuideInfo.cs</Link>
</Compile> </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\LiveTvChannelQuery.cs">
<Link>LiveTv\LiveTvChannelQuery.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\LiveTvChannelType.cs">
<Link>LiveTv\LiveTvChannelType.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\LiveTvInfo.cs"> <Compile Include="..\MediaBrowser.Model\LiveTv\LiveTvInfo.cs">
<Link>LiveTv\LiveTvInfo.cs</Link> <Link>LiveTv\LiveTvInfo.cs</Link>
</Compile> </Compile>

View file

@ -463,18 +463,18 @@
<Compile Include="..\MediaBrowser.Model\LiveTv\ChannelInfoDto.cs"> <Compile Include="..\MediaBrowser.Model\LiveTv\ChannelInfoDto.cs">
<Link>LiveTv\ChannelInfoDto.cs</Link> <Link>LiveTv\ChannelInfoDto.cs</Link>
</Compile> </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\ChannelQuery.cs">
<Link>LiveTv\ChannelQuery.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\ChannelType.cs">
<Link>LiveTv\ChannelType.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\DayPattern.cs"> <Compile Include="..\MediaBrowser.Model\LiveTv\DayPattern.cs">
<Link>LiveTv\DayPattern.cs</Link> <Link>LiveTv\DayPattern.cs</Link>
</Compile> </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\GuideInfo.cs"> <Compile Include="..\MediaBrowser.Model\LiveTv\GuideInfo.cs">
<Link>LiveTv\GuideInfo.cs</Link> <Link>LiveTv\GuideInfo.cs</Link>
</Compile> </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\LiveTvChannelQuery.cs">
<Link>LiveTv\LiveTvChannelQuery.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\LiveTvChannelType.cs">
<Link>LiveTv\LiveTvChannelType.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\LiveTvInfo.cs"> <Compile Include="..\MediaBrowser.Model\LiveTv\LiveTvInfo.cs">
<Link>LiveTv\LiveTvInfo.cs</Link> <Link>LiveTv\LiveTvInfo.cs</Link>
</Compile> </Compile>

View file

@ -1,4 +1,5 @@
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Globalization;
@ -1147,5 +1148,29 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{SeriesTimerInfoDto}.</returns> /// <returns>Task{SeriesTimerInfoDto}.</returns>
Task<SeriesTimerInfoDto> GetDefaultLiveTvTimerInfo(string programId, CancellationToken cancellationToken); Task<SeriesTimerInfoDto> GetDefaultLiveTvTimerInfo(string programId, CancellationToken cancellationToken);
/// <summary>
/// Gets the channel features.
/// </summary>
/// <param name="channelId">The channel identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{ChannelFeatures}.</returns>
Task<ChannelFeatures> GetChannelFeatures(string channelId, 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);
/// <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);
} }
} }

View file

@ -62,7 +62,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the type of the channel. /// Gets or sets the type of the channel.
/// </summary> /// </summary>
/// <value>The type of the channel.</value> /// <value>The type of the channel.</value>
public ChannelType ChannelType { get; set; } public LiveTvChannelType ChannelType { get; set; }
/// <summary> /// <summary>
/// Gets or sets the type. /// Gets or sets the type.

View file

@ -4,13 +4,13 @@ namespace MediaBrowser.Model.LiveTv
/// <summary> /// <summary>
/// Class ChannelQuery. /// Class ChannelQuery.
/// </summary> /// </summary>
public class ChannelQuery public class LiveTvChannelQuery
{ {
/// <summary> /// <summary>
/// Gets or sets the type of the channel. /// Gets or sets the type of the channel.
/// </summary> /// </summary>
/// <value>The type of the channel.</value> /// <value>The type of the channel.</value>
public ChannelType? ChannelType { get; set; } public LiveTvChannelType? ChannelType { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance is favorite. /// Gets or sets a value indicating whether this instance is favorite.

View file

@ -4,7 +4,7 @@ namespace MediaBrowser.Model.LiveTv
/// <summary> /// <summary>
/// Enum ChannelType /// Enum ChannelType
/// </summary> /// </summary>
public enum ChannelType public enum LiveTvChannelType
{ {
/// <summary> /// <summary>
/// The TV /// The TV

View file

@ -164,7 +164,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the type of the channel. /// Gets or sets the type of the channel.
/// </summary> /// </summary>
/// <value>The type of the channel.</value> /// <value>The type of the channel.</value>
public ChannelType ChannelType { get; set; } public LiveTvChannelType ChannelType { get; set; }
/// <summary> /// <summary>
/// Gets or sets the official rating. /// Gets or sets the official rating.

View file

@ -154,7 +154,7 @@
<Compile Include="Library\PlayAccess.cs" /> <Compile Include="Library\PlayAccess.cs" />
<Compile Include="LiveTv\BaseTimerInfoDto.cs" /> <Compile Include="LiveTv\BaseTimerInfoDto.cs" />
<Compile Include="LiveTv\ChannelInfoDto.cs" /> <Compile Include="LiveTv\ChannelInfoDto.cs" />
<Compile Include="LiveTv\ChannelQuery.cs" /> <Compile Include="LiveTv\LiveTvChannelQuery.cs" />
<Compile Include="LiveTv\DayPattern.cs" /> <Compile Include="LiveTv\DayPattern.cs" />
<Compile Include="LiveTv\GuideInfo.cs" /> <Compile Include="LiveTv\GuideInfo.cs" />
<Compile Include="LiveTv\LiveTvInfo.cs" /> <Compile Include="LiveTv\LiveTvInfo.cs" />
@ -200,7 +200,7 @@
<Compile Include="IO\IIsoManager.cs" /> <Compile Include="IO\IIsoManager.cs" />
<Compile Include="IO\IIsoMount.cs" /> <Compile Include="IO\IIsoMount.cs" />
<Compile Include="IO\IIsoMounter.cs" /> <Compile Include="IO\IIsoMounter.cs" />
<Compile Include="LiveTv\ChannelType.cs" /> <Compile Include="LiveTv\LiveTvChannelType.cs" />
<Compile Include="LiveTv\LiveTvServiceInfo.cs" /> <Compile Include="LiveTv\LiveTvServiceInfo.cs" />
<Compile Include="LiveTv\RecordingInfoDto.cs" /> <Compile Include="LiveTv\RecordingInfoDto.cs" />
<Compile Include="Net\WebSocketMessage.cs" /> <Compile Include="Net\WebSocketMessage.cs" />

View file

@ -206,7 +206,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
IsRepeat = info.IsRepeat, IsRepeat = info.IsRepeat,
EpisodeTitle = info.EpisodeTitle, EpisodeTitle = info.EpisodeTitle,
ChannelType = info.ChannelType, ChannelType = info.ChannelType,
MediaType = info.ChannelType == ChannelType.Radio ? MediaType.Audio : MediaType.Video, MediaType = info.ChannelType == LiveTvChannelType.Radio ? MediaType.Audio : MediaType.Video,
CommunityRating = GetClientCommunityRating(info.CommunityRating), CommunityRating = GetClientCommunityRating(info.CommunityRating),
OfficialRating = info.OfficialRating, OfficialRating = info.OfficialRating,
Audio = info.Audio, Audio = info.Audio,

View file

@ -118,7 +118,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
_taskManager.CancelIfRunningAndQueue<RefreshChannelsScheduledTask>(); _taskManager.CancelIfRunningAndQueue<RefreshChannelsScheduledTask>();
} }
public async Task<QueryResult<ChannelInfoDto>> GetChannels(ChannelQuery query, CancellationToken cancellationToken) public async Task<QueryResult<ChannelInfoDto>> GetChannels(LiveTvChannelQuery query, CancellationToken cancellationToken)
{ {
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(new Guid(query.UserId)); var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(new Guid(query.UserId));
@ -416,7 +416,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
return item; return item;
} }
private LiveTvProgram GetProgram(ProgramInfo info, ChannelType channelType, string serviceName, CancellationToken cancellationToken) private LiveTvProgram GetProgram(ProgramInfo info, LiveTvChannelType channelType, string serviceName, CancellationToken cancellationToken)
{ {
var id = _tvDtoService.GetInternalProgramId(serviceName, info.Id); var id = _tvDtoService.GetInternalProgramId(serviceName, info.Id);
@ -475,7 +475,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
if (item == null) if (item == null)
{ {
if (info.ChannelType == ChannelType.TV) if (info.ChannelType == LiveTvChannelType.TV)
{ {
item = new LiveTvVideoRecording item = new LiveTvVideoRecording
{ {