update live tv queries

This commit is contained in:
Luke Pulverenti 2017-12-05 13:30:49 -05:00
parent 4ec4d38f49
commit 85815adcd2
3 changed files with 9 additions and 1 deletions

View File

@ -1021,7 +1021,8 @@ namespace Emby.Server.Implementations.LiveTv
EnableTotalRecordCount = query.EnableTotalRecordCount, EnableTotalRecordCount = query.EnableTotalRecordCount,
OrderBy = new[] { new Tuple<string, SortOrder>(ItemSortBy.StartDate, SortOrder.Ascending) }, OrderBy = new[] { new Tuple<string, SortOrder>(ItemSortBy.StartDate, SortOrder.Ascending) },
TopParentIds = new[] { topFolder.Id.ToString("N") }, TopParentIds = new[] { topFolder.Id.ToString("N") },
DtoOptions = options DtoOptions = options,
GenreIds = query.GenreIds
}; };
if (query.Limit.HasValue) if (query.Limit.HasValue)

View File

@ -459,6 +459,9 @@ namespace MediaBrowser.Api.LiveTv
[ApiMember(Name = "EnableImageTypes", Description = "Optional. The image types to include in the output.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "EnableImageTypes", Description = "Optional. The image types to include in the output.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string EnableImageTypes { get; set; } public string EnableImageTypes { get; set; }
[ApiMember(Name = "GenreIds", Description = "The genres to return guide information for.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET,POST")]
public string GenreIds { get; set; }
/// <summary> /// <summary>
/// Fields to return within the items, in addition to basic information /// Fields to return within the items, in addition to basic information
/// </summary> /// </summary>
@ -1040,6 +1043,8 @@ namespace MediaBrowser.Api.LiveTv
EnableTotalRecordCount = request.EnableTotalRecordCount EnableTotalRecordCount = request.EnableTotalRecordCount
}; };
query.GenreIds = (request.GenreIds ?? String.Empty).Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
var result = _liveTvManager.GetRecommendedPrograms(query, GetDtoOptions(_authContext, request), CancellationToken.None); var result = _liveTvManager.GetRecommendedPrograms(query, GetDtoOptions(_authContext, request), CancellationToken.None);
return ToOptimizedResult(result); return ToOptimizedResult(result);

View File

@ -13,12 +13,14 @@ namespace MediaBrowser.Model.LiveTv
public bool? EnableImages { get; set; } public bool? EnableImages { get; set; }
public int? ImageTypeLimit { get; set; } public int? ImageTypeLimit { get; set; }
public ImageType[] EnableImageTypes { get; set; } public ImageType[] EnableImageTypes { get; set; }
public string[] GenreIds { get; set; }
public bool EnableTotalRecordCount { get; set; } public bool EnableTotalRecordCount { get; set; }
public RecommendedProgramQuery() public RecommendedProgramQuery()
{ {
EnableTotalRecordCount = true; EnableTotalRecordCount = true;
GenreIds = new string[] { };
} }
/// <summary> /// <summary>