change IsRecording filter to IsInProgress

pull/702/head
Luke Pulverenti 11 years ago
parent ca831ae88a
commit 98b6046f04

@ -78,8 +78,11 @@ namespace MediaBrowser.Api.LiveTv
[ApiMember(Name = "Limit", Description = "Optional. The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] [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; } public int? Limit { get; set; }
[ApiMember(Name = "IsRecording", Description = "Optional filter by recordings that are currently active, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "Status", Description = "Optional filter by recording status.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public bool? IsRecording { get; set; } public RecordingStatus? Status { get; set; }
[ApiMember(Name = "Status", Description = "Optional filter by recordings that are in progress, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public bool? IsInProgress { get; set; }
[ApiMember(Name = "SeriesTimerId", Description = "Optional filter by recordings belonging to a series timer", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [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; } public string SeriesTimerId { get; set; }
@ -398,8 +401,9 @@ 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, Status = request.Status,
SeriesTimerId = request.SeriesTimerId SeriesTimerId = request.SeriesTimerId,
IsInProgress = request.IsInProgress
}, CancellationToken.None).Result; }, CancellationToken.None).Result;

@ -51,12 +51,6 @@ namespace MediaBrowser.Model.LiveTv
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary>
/// Gets or sets the type of the location.
/// </summary>
/// <value>The type of the location.</value>
public LocationType LocationType { get; set; }
/// <summary> /// <summary>
/// Gets or sets the media streams. /// Gets or sets the media streams.
/// </summary> /// </summary>
@ -69,12 +63,6 @@ namespace MediaBrowser.Model.LiveTv
/// <value>The path.</value> /// <value>The path.</value>
public string Path { get; set; } public string Path { get; set; }
/// <summary>
/// Gets or sets the URL.
/// </summary>
/// <value>The URL.</value>
public string Url { get; set; }
/// <summary> /// <summary>
/// Overview of the recording. /// Overview of the recording.
/// </summary> /// </summary>

@ -44,10 +44,16 @@ namespace MediaBrowser.Model.LiveTv
public int? Limit { get; set; } public int? Limit { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance is recording. /// Gets or sets the status.
/// </summary> /// </summary>
/// <value><c>null</c> if [is recording] contains no value, <c>true</c> if [is recording]; otherwise, <c>false</c>.</value> /// <value>The status.</value>
public bool? IsRecording { get; set; } public RecordingStatus? Status { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is in progress.
/// </summary>
/// <value><c>null</c> if [is in progress] contains no value, <c>true</c> if [is in progress]; otherwise, <c>false</c>.</value>
public bool? IsInProgress { get; set; }
/// <summary> /// <summary>
/// Gets or sets the series timer identifier. /// Gets or sets the series timer identifier.

@ -212,7 +212,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
Audio = info.Audio, Audio = info.Audio,
IsHD = info.IsHD, IsHD = info.IsHD,
ServiceName = service.Name, ServiceName = service.Name,
Url = info.Url,
IsMovie = info.IsMovie, IsMovie = info.IsMovie,
IsSeries = info.IsSeries, IsSeries = info.IsSeries,
IsSports = info.IsSports, IsSports = info.IsSports,
@ -221,7 +220,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
IsKids = info.IsKids, IsKids = info.IsKids,
IsPremiere = info.IsPremiere, IsPremiere = info.IsPremiere,
RunTimeTicks = (info.EndDate - info.StartDate).Ticks, RunTimeTicks = (info.EndDate - info.StartDate).Ticks,
LocationType = recording.LocationType,
OriginalAirDate = info.OriginalAirDate, OriginalAirDate = info.OriginalAirDate,
MediaStreams = _itemRepo.GetMediaStreams(new MediaStreamQuery MediaStreams = _itemRepo.GetMediaStreams(new MediaStreamQuery

@ -50,7 +50,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
private List<Guid> _channelIdList = new List<Guid>(); private List<Guid> _channelIdList = new List<Guid>();
private Dictionary<Guid, LiveTvProgram> _programs = new Dictionary<Guid, LiveTvProgram>(); private Dictionary<Guid, LiveTvProgram> _programs = new Dictionary<Guid, LiveTvProgram>();
public LiveTvManager(IServerConfigurationManager config, IFileSystem fileSystem, ILogger logger, IItemRepository itemRepo, IImageProcessor imageProcessor, IUserDataManager userDataManager, IDtoService dtoService, IUserManager userManager, ILibraryManager libraryManager, IMediaEncoder mediaEncoder) public LiveTvManager(IServerConfigurationManager config, IFileSystem fileSystem, ILogger logger, IItemRepository itemRepo, IImageProcessor imageProcessor, IUserDataManager userDataManager, IDtoService dtoService, IUserManager userManager, ILibraryManager libraryManager, IMediaEncoder mediaEncoder, ITaskManager taskManager)
{ {
_config = config; _config = config;
_fileSystem = fileSystem; _fileSystem = fileSystem;
@ -59,6 +59,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
_userManager = userManager; _userManager = userManager;
_libraryManager = libraryManager; _libraryManager = libraryManager;
_mediaEncoder = mediaEncoder; _mediaEncoder = mediaEncoder;
_taskManager = taskManager;
_userDataManager = userDataManager; _userDataManager = userDataManager;
_tvDtoService = new LiveTvDtoService(dtoService, userDataManager, imageProcessor, logger, _itemRepo); _tvDtoService = new LiveTvDtoService(dtoService, userDataManager, imageProcessor, logger, _itemRepo);
@ -780,12 +781,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv
recordings = recordings.Where(i => GetRecordingGroupIds(i).Contains(guid)); recordings = recordings.Where(i => GetRecordingGroupIds(i).Contains(guid));
} }
if (query.IsRecording.HasValue) if (query.IsInProgress.HasValue)
{ {
var val = query.IsRecording.Value; var val = query.IsInProgress.Value;
recordings = recordings.Where(i => (i.Status == RecordingStatus.InProgress) == val); recordings = recordings.Where(i => (i.Status == RecordingStatus.InProgress) == val);
} }
if (query.Status.HasValue)
{
var val = query.Status.Value;
recordings = recordings.Where(i => (i.Status == val));
}
if (!string.IsNullOrEmpty(query.SeriesTimerId)) if (!string.IsNullOrEmpty(query.SeriesTimerId))
{ {
var guid = new Guid(query.SeriesTimerId); var guid = new Guid(query.SeriesTimerId);

@ -291,7 +291,7 @@ namespace MediaBrowser.ServerApplication
await RegisterMediaEncoder(innerProgress).ConfigureAwait(false); await RegisterMediaEncoder(innerProgress).ConfigureAwait(false);
progress.Report(90); progress.Report(90);
LiveTvManager = new LiveTvManager(ServerConfigurationManager, FileSystemManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, MediaEncoder); LiveTvManager = new LiveTvManager(ServerConfigurationManager, FileSystemManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, MediaEncoder, TaskManager);
RegisterSingleInstance(LiveTvManager); RegisterSingleInstance(LiveTvManager);
var displayPreferencesTask = Task.Run(async () => await ConfigureDisplayPreferencesRepositories().ConfigureAwait(false)); var displayPreferencesTask = Task.Run(async () => await ConfigureDisplayPreferencesRepositories().ConfigureAwait(false));

Loading…
Cancel
Save