From df83adbb71af569468ec58645b3e52d8c4e6778b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 31 May 2014 11:13:07 -0400 Subject: rename channel query objects --- MediaBrowser.Api/LiveTv/LiveTvService.cs | 4 +- MediaBrowser.Controller/LiveTv/ChannelInfo.cs | 2 +- MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 2 +- MediaBrowser.Controller/LiveTv/LiveTvChannel.cs | 4 +- MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 4 +- MediaBrowser.Controller/LiveTv/RecordingInfo.cs | 2 +- .../MediaBrowser.Model.Portable.csproj | 12 ++--- .../MediaBrowser.Model.net35.csproj | 12 ++--- MediaBrowser.Model/ApiClient/IApiClient.cs | 27 +++++++++++- MediaBrowser.Model/LiveTv/ChannelInfoDto.cs | 2 +- MediaBrowser.Model/LiveTv/ChannelQuery.cs | 51 ---------------------- MediaBrowser.Model/LiveTv/ChannelType.cs | 19 -------- MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs | 51 ++++++++++++++++++++++ MediaBrowser.Model/LiveTv/LiveTvChannelType.cs | 19 ++++++++ MediaBrowser.Model/LiveTv/RecordingInfoDto.cs | 2 +- MediaBrowser.Model/MediaBrowser.Model.csproj | 4 +- .../LiveTv/LiveTvDtoService.cs | 2 +- .../LiveTv/LiveTvManager.cs | 6 +-- 18 files changed, 125 insertions(+), 100 deletions(-) delete mode 100644 MediaBrowser.Model/LiveTv/ChannelQuery.cs delete mode 100644 MediaBrowser.Model/LiveTv/ChannelType.cs create mode 100644 MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs create mode 100644 MediaBrowser.Model/LiveTv/LiveTvChannelType.cs diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs index a6074e529..2a83e57b3 100644 --- a/MediaBrowser.Api/LiveTv/LiveTvService.cs +++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs @@ -21,7 +21,7 @@ namespace MediaBrowser.Api.LiveTv public class GetChannels : IReturn> { [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")] public string UserId { get; set; } @@ -294,7 +294,7 @@ namespace MediaBrowser.Api.LiveTv public object Get(GetChannels request) { - var result = _liveTvManager.GetChannels(new ChannelQuery + var result = _liveTvManager.GetChannels(new LiveTvChannelQuery { ChannelType = request.Type, UserId = request.UserId, diff --git a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs index cdc9c76c8..0d074c6c8 100644 --- a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs @@ -29,7 +29,7 @@ namespace MediaBrowser.Controller.LiveTv /// Gets or sets the type of the channel. /// /// The type of the channel. - public ChannelType ChannelType { get; set; } + public LiveTvChannelType ChannelType { get; set; } /// /// Supply the image path if it can be accessed directly from the file system diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index dddd26358..6899b7a59 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -72,7 +72,7 @@ namespace MediaBrowser.Controller.LiveTv /// The query. /// The cancellation token. /// IEnumerable{Channel}. - Task> GetChannels(ChannelQuery query, CancellationToken cancellationToken); + Task> GetChannels(LiveTvChannelQuery query, CancellationToken cancellationToken); /// /// Gets the recording. diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index 5b78b6789..65b0006a2 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -63,7 +63,7 @@ namespace MediaBrowser.Controller.LiveTv /// Gets or sets the type of the channel. /// /// The type of the channel. - public ChannelType ChannelType { get; set; } + public LiveTvChannelType ChannelType { get; set; } public string ServiceName { get; set; } @@ -101,7 +101,7 @@ namespace MediaBrowser.Controller.LiveTv { 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; } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 266eaabee..47c1fda68 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -35,7 +35,7 @@ namespace MediaBrowser.Controller.LiveTv /// Gets or sets the type of the channel. /// /// The type of the channel. - public ChannelType ChannelType { get; set; } + public LiveTvChannelType ChannelType { get; set; } /// /// The start date of the program, in UTC. @@ -161,7 +161,7 @@ namespace MediaBrowser.Controller.LiveTv { 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; } } diff --git a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs index bf453ccf4..4ea1961e0 100644 --- a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs +++ b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs @@ -26,7 +26,7 @@ namespace MediaBrowser.Controller.LiveTv /// Gets or sets the type of the channel. /// /// The type of the channel. - public ChannelType ChannelType { get; set; } + public LiveTvChannelType ChannelType { get; set; } /// /// Name of the recording. diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj index 561d0d9e4..f17a9c6db 100644 --- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj +++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj @@ -482,18 +482,18 @@ LiveTv\ChannelInfoDto.cs - - LiveTv\ChannelQuery.cs - - - LiveTv\ChannelType.cs - LiveTv\DayPattern.cs LiveTv\GuideInfo.cs + + LiveTv\LiveTvChannelQuery.cs + + + LiveTv\LiveTvChannelType.cs + LiveTv\LiveTvInfo.cs diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj index 92f0afb53..41afdea27 100644 --- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj +++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj @@ -463,18 +463,18 @@ LiveTv\ChannelInfoDto.cs - - LiveTv\ChannelQuery.cs - - - LiveTv\ChannelType.cs - LiveTv\DayPattern.cs LiveTv\GuideInfo.cs + + LiveTv\LiveTvChannelQuery.cs + + + LiveTv\LiveTvChannelType.cs + LiveTv\LiveTvInfo.cs diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index f30bb5daf..e5597cbc0 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Channels; +using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Globalization; @@ -1147,5 +1148,29 @@ namespace MediaBrowser.Model.ApiClient /// The cancellation token. /// Task{SeriesTimerInfoDto}. Task GetDefaultLiveTvTimerInfo(string programId, CancellationToken cancellationToken); + + /// + /// Gets the channel features. + /// + /// The channel identifier. + /// The cancellation token. + /// Task{ChannelFeatures}. + Task GetChannelFeatures(string channelId, CancellationToken cancellationToken); + + /// + /// Gets the channel items. + /// + /// The query. + /// The cancellation token. + /// Task{QueryResult{BaseItemDto}}. + Task> GetChannelItems(ChannelItemQuery query, CancellationToken cancellationToken); + + /// + /// Gets the channels. + /// + /// The query. + /// The cancellation token. + /// Task{QueryResult{BaseItemDto}}. + Task> GetChannels(ChannelQuery query, CancellationToken cancellationToken); } } \ No newline at end of file diff --git a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs index 2f244b4e3..8be745a12 100644 --- a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs @@ -62,7 +62,7 @@ namespace MediaBrowser.Model.LiveTv /// Gets or sets the type of the channel. /// /// The type of the channel. - public ChannelType ChannelType { get; set; } + public LiveTvChannelType ChannelType { get; set; } /// /// Gets or sets the type. diff --git a/MediaBrowser.Model/LiveTv/ChannelQuery.cs b/MediaBrowser.Model/LiveTv/ChannelQuery.cs deleted file mode 100644 index 6d986d337..000000000 --- a/MediaBrowser.Model/LiveTv/ChannelQuery.cs +++ /dev/null @@ -1,51 +0,0 @@ - -namespace MediaBrowser.Model.LiveTv -{ - /// - /// Class ChannelQuery. - /// - public class ChannelQuery - { - /// - /// Gets or sets the type of the channel. - /// - /// The type of the channel. - public ChannelType? ChannelType { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is favorite. - /// - /// null if [is favorite] contains no value, true if [is favorite]; otherwise, false. - public bool? IsFavorite { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is liked. - /// - /// null if [is liked] contains no value, true if [is liked]; otherwise, false. - public bool? IsLiked { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is disliked. - /// - /// null if [is disliked] contains no value, true if [is disliked]; otherwise, false. - public bool? IsDisliked { get; set; } - - /// - /// Gets or sets the user identifier. - /// - /// The user identifier. - public string UserId { get; set; } - - /// - /// Skips over a given number of items within the results. Use for paging. - /// - /// The start index. - public int? StartIndex { get; set; } - - /// - /// The maximum number of items to return - /// - /// The limit. - public int? Limit { get; set; } - } -} diff --git a/MediaBrowser.Model/LiveTv/ChannelType.cs b/MediaBrowser.Model/LiveTv/ChannelType.cs deleted file mode 100644 index bca16f839..000000000 --- a/MediaBrowser.Model/LiveTv/ChannelType.cs +++ /dev/null @@ -1,19 +0,0 @@ - -namespace MediaBrowser.Model.LiveTv -{ - /// - /// Enum ChannelType - /// - public enum ChannelType - { - /// - /// The TV - /// - TV, - - /// - /// The radio - /// - Radio - } -} diff --git a/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs b/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs new file mode 100644 index 000000000..75fcb7a10 --- /dev/null +++ b/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs @@ -0,0 +1,51 @@ + +namespace MediaBrowser.Model.LiveTv +{ + /// + /// Class ChannelQuery. + /// + public class LiveTvChannelQuery + { + /// + /// Gets or sets the type of the channel. + /// + /// The type of the channel. + public LiveTvChannelType? ChannelType { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is favorite. + /// + /// null if [is favorite] contains no value, true if [is favorite]; otherwise, false. + public bool? IsFavorite { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is liked. + /// + /// null if [is liked] contains no value, true if [is liked]; otherwise, false. + public bool? IsLiked { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is disliked. + /// + /// null if [is disliked] contains no value, true if [is disliked]; otherwise, false. + public bool? IsDisliked { get; set; } + + /// + /// Gets or sets the user identifier. + /// + /// The user identifier. + public string UserId { get; set; } + + /// + /// Skips over a given number of items within the results. Use for paging. + /// + /// The start index. + public int? StartIndex { get; set; } + + /// + /// The maximum number of items to return + /// + /// The limit. + public int? Limit { get; set; } + } +} diff --git a/MediaBrowser.Model/LiveTv/LiveTvChannelType.cs b/MediaBrowser.Model/LiveTv/LiveTvChannelType.cs new file mode 100644 index 000000000..d447f73a2 --- /dev/null +++ b/MediaBrowser.Model/LiveTv/LiveTvChannelType.cs @@ -0,0 +1,19 @@ + +namespace MediaBrowser.Model.LiveTv +{ + /// + /// Enum ChannelType + /// + public enum LiveTvChannelType + { + /// + /// The TV + /// + TV, + + /// + /// The radio + /// + Radio + } +} diff --git a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs index 58bca06bd..d03e1a4e4 100644 --- a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs @@ -164,7 +164,7 @@ namespace MediaBrowser.Model.LiveTv /// Gets or sets the type of the channel. /// /// The type of the channel. - public ChannelType ChannelType { get; set; } + public LiveTvChannelType ChannelType { get; set; } /// /// Gets or sets the official rating. diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index c98db03c0..1a66adafd 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -154,7 +154,7 @@ - + @@ -200,7 +200,7 @@ - + diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs index 8d9abc128..b03139c64 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs @@ -206,7 +206,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv IsRepeat = info.IsRepeat, EpisodeTitle = info.EpisodeTitle, 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), OfficialRating = info.OfficialRating, Audio = info.Audio, diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index bc22c531c..a449b525c 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -118,7 +118,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv _taskManager.CancelIfRunningAndQueue(); } - public async Task> GetChannels(ChannelQuery query, CancellationToken cancellationToken) + public async Task> GetChannels(LiveTvChannelQuery query, CancellationToken cancellationToken) { var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(new Guid(query.UserId)); @@ -416,7 +416,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv 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); @@ -475,7 +475,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv if (item == null) { - if (info.ChannelType == ChannelType.TV) + if (info.ChannelType == LiveTvChannelType.TV) { item = new LiveTvVideoRecording { -- cgit v1.2.3