implement direct play profile edit

pull/702/head
Luke Pulverenti 11 years ago
parent 5e5b1f180c
commit 1aa7eb4c62

@ -39,6 +39,9 @@ namespace MediaBrowser.Api.LiveTv
/// <value>The limit.</value>
[ApiMember(Name = "Limit", Description = "Optional. The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
public int? Limit { get; set; }
[ApiMember(Name = "IsFavorite", Description = "Filter by channels that are favorites, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public bool? IsFavorite { get; set; }
}
[Route("/LiveTv/Channels/{Id}", "GET", Summary = "Gets a live tv channel")]
@ -290,7 +293,8 @@ namespace MediaBrowser.Api.LiveTv
ChannelType = request.Type,
UserId = request.UserId,
StartIndex = request.StartIndex,
Limit = request.Limit
Limit = request.Limit,
IsFavorite = request.IsFavorite
}, CancellationToken.None).Result;

@ -12,6 +12,12 @@ namespace MediaBrowser.Model.LiveTv
/// <value>The type of the channel.</value>
public ChannelType? ChannelType { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is favorite.
/// </summary>
/// <value><c>null</c> if [is favorite] contains no value, <c>true</c> if [is favorite]; otherwise, <c>false</c>.</value>
public bool? IsFavorite { get; set; }
/// <summary>
/// Gets or sets the user identifier.
/// </summary>

@ -1297,7 +1297,7 @@ namespace MediaBrowser.Server.Implementations.Dto
{
var result = new List<MediaSourceInfo>
{
GetVersionInfo(item, true)
GetVersionInfo(item)
};
return result;
@ -1321,7 +1321,7 @@ namespace MediaBrowser.Server.Implementations.Dto
};
}
private MediaSourceInfo GetVersionInfo(Audio i, bool isPrimary)
private MediaSourceInfo GetVersionInfo(Audio i)
{
return new MediaSourceInfo
{

@ -134,6 +134,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv
return number;
});
if (query.IsFavorite.HasValue)
{
var val = query.IsFavorite.Value;
channels = channels
.Where(i => _userDataManager.GetUserData(user.Id, i.GetUserDataKey()).IsFavorite == val);
}
}
channels = channels.OrderBy(i =>

Loading…
Cancel
Save