mirror of https://github.com/jellyfin/jellyfin.git
add new tab to series timer page
This commit is contained in:
parent
ed87558e94
commit
2e499c60e0
|
@ -65,6 +65,9 @@ namespace MediaBrowser.Api.LiveTv
|
||||||
|
|
||||||
[ApiMember(Name = "IsRecording", Description = "Optional filter by recordings that are currently active, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
|
[ApiMember(Name = "IsRecording", Description = "Optional filter by recordings that are currently active, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
|
||||||
public bool? IsRecording { get; set; }
|
public bool? IsRecording { get; set; }
|
||||||
|
|
||||||
|
[ApiMember(Name = "SeriesTimerId", Description = "Optional filter by recordings belonging to a series timer", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
|
||||||
|
public string SeriesTimerId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("/LiveTv/Recordings/Groups", "GET")]
|
[Route("/LiveTv/Recordings/Groups", "GET")]
|
||||||
|
@ -108,6 +111,9 @@ namespace MediaBrowser.Api.LiveTv
|
||||||
{
|
{
|
||||||
[ApiMember(Name = "ChannelId", Description = "Optional filter by channel id.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
|
[ApiMember(Name = "ChannelId", Description = "Optional filter by channel id.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
|
||||||
public string ChannelId { get; set; }
|
public string ChannelId { get; set; }
|
||||||
|
|
||||||
|
[ApiMember(Name = "SeriesTimerId", Description = "Optional filter by timers belonging to a series timer", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
|
||||||
|
public string SeriesTimerId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("/LiveTv/Programs", "GET")]
|
[Route("/LiveTv/Programs", "GET")]
|
||||||
|
@ -312,7 +318,8 @@ namespace MediaBrowser.Api.LiveTv
|
||||||
GroupId = request.GroupId,
|
GroupId = request.GroupId,
|
||||||
StartIndex = request.StartIndex,
|
StartIndex = request.StartIndex,
|
||||||
Limit = request.Limit,
|
Limit = request.Limit,
|
||||||
IsRecording = request.IsRecording
|
IsRecording = request.IsRecording,
|
||||||
|
SeriesTimerId = request.SeriesTimerId
|
||||||
|
|
||||||
}, CancellationToken.None).Result;
|
}, CancellationToken.None).Result;
|
||||||
|
|
||||||
|
@ -339,7 +346,8 @@ namespace MediaBrowser.Api.LiveTv
|
||||||
{
|
{
|
||||||
var result = _liveTvManager.GetTimers(new TimerQuery
|
var result = _liveTvManager.GetTimers(new TimerQuery
|
||||||
{
|
{
|
||||||
ChannelId = request.ChannelId
|
ChannelId = request.ChannelId,
|
||||||
|
SeriesTimerId = request.SeriesTimerId
|
||||||
|
|
||||||
}, CancellationToken.None).Result;
|
}, CancellationToken.None).Result;
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,12 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value><c>null</c> if [is recording] contains no value, <c>true</c> if [is recording]; otherwise, <c>false</c>.</value>
|
/// <value><c>null</c> if [is recording] contains no value, <c>true</c> if [is recording]; otherwise, <c>false</c>.</value>
|
||||||
public bool? IsRecording { get; set; }
|
public bool? IsRecording { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the series timer identifier.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The series timer identifier.</value>
|
||||||
|
public string SeriesTimerId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RecordingGroupQuery
|
public class RecordingGroupQuery
|
||||||
|
@ -64,6 +70,12 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The channel identifier.</value>
|
/// <value>The channel identifier.</value>
|
||||||
public string ChannelId { get; set; }
|
public string ChannelId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the series timer identifier.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The series timer identifier.</value>
|
||||||
|
public string SeriesTimerId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SeriesTimerQuery
|
public class SeriesTimerQuery
|
||||||
|
|
|
@ -565,6 +565,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
recordings = recordings.Where(i => (i.Status == RecordingStatus.InProgress) == val);
|
recordings = recordings.Where(i => (i.Status == RecordingStatus.InProgress) == val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(query.SeriesTimerId))
|
||||||
|
{
|
||||||
|
var guid = new Guid(query.SeriesTimerId);
|
||||||
|
|
||||||
|
var currentServiceName = service.Name;
|
||||||
|
|
||||||
|
recordings = recordings
|
||||||
|
.Where(i => _tvDtoService.GetInternalSeriesTimerId(currentServiceName, i.SeriesTimerId) == guid);
|
||||||
|
}
|
||||||
|
|
||||||
IEnumerable<ILiveTvRecording> entities = await GetEntities(recordings, service.Name, cancellationToken).ConfigureAwait(false);
|
IEnumerable<ILiveTvRecording> entities = await GetEntities(recordings, service.Name, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
entities = entities.OrderByDescending(i => i.RecordingInfo.StartDate);
|
entities = entities.OrderByDescending(i => i.RecordingInfo.StartDate);
|
||||||
|
@ -640,6 +650,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
timers = timers.Where(i => guid == _tvDtoService.GetInternalChannelId(service.Name, i.ChannelId));
|
timers = timers.Where(i => guid == _tvDtoService.GetInternalChannelId(service.Name, i.ChannelId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(query.SeriesTimerId))
|
||||||
|
{
|
||||||
|
var guid = new Guid(query.SeriesTimerId);
|
||||||
|
|
||||||
|
var currentServiceName = service.Name;
|
||||||
|
|
||||||
|
timers = timers
|
||||||
|
.Where(i => _tvDtoService.GetInternalSeriesTimerId(currentServiceName, i.SeriesTimerId) == guid);
|
||||||
|
}
|
||||||
|
|
||||||
var returnArray = timers
|
var returnArray = timers
|
||||||
.Select(i =>
|
.Select(i =>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue