diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs index 20b1af8b25..ba4f0fb101 100644 --- a/MediaBrowser.Api/LiveTv/LiveTvService.cs +++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs @@ -78,9 +78,12 @@ namespace MediaBrowser.Api.LiveTv [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 = "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; } + [ApiMember(Name = "Status", Description = "Optional filter by recording status.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + 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")] public string SeriesTimerId { get; set; } } @@ -398,8 +401,9 @@ namespace MediaBrowser.Api.LiveTv GroupId = request.GroupId, StartIndex = request.StartIndex, Limit = request.Limit, - IsRecording = request.IsRecording, - SeriesTimerId = request.SeriesTimerId + Status = request.Status, + SeriesTimerId = request.SeriesTimerId, + IsInProgress = request.IsInProgress }, CancellationToken.None).Result; diff --git a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs index 4d56d0ae39..ceb976689d 100644 --- a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs @@ -51,12 +51,6 @@ namespace MediaBrowser.Model.LiveTv /// public string Name { get; set; } - /// - /// Gets or sets the type of the location. - /// - /// The type of the location. - public LocationType LocationType { get; set; } - /// /// Gets or sets the media streams. /// @@ -69,12 +63,6 @@ namespace MediaBrowser.Model.LiveTv /// The path. public string Path { get; set; } - /// - /// Gets or sets the URL. - /// - /// The URL. - public string Url { get; set; } - /// /// Overview of the recording. /// diff --git a/MediaBrowser.Model/LiveTv/RecordingQuery.cs b/MediaBrowser.Model/LiveTv/RecordingQuery.cs index 8f82433cc7..1fa9af49b3 100644 --- a/MediaBrowser.Model/LiveTv/RecordingQuery.cs +++ b/MediaBrowser.Model/LiveTv/RecordingQuery.cs @@ -44,10 +44,16 @@ namespace MediaBrowser.Model.LiveTv public int? Limit { get; set; } /// - /// Gets or sets a value indicating whether this instance is recording. + /// Gets or sets the status. /// - /// null if [is recording] contains no value, true if [is recording]; otherwise, false. - public bool? IsRecording { get; set; } + /// The status. + public RecordingStatus? Status { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is in progress. + /// + /// null if [is in progress] contains no value, true if [is in progress]; otherwise, false. + public bool? IsInProgress { get; set; } /// /// Gets or sets the series timer identifier. diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs index 55fa47ff77..1546f8045f 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs @@ -212,7 +212,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv Audio = info.Audio, IsHD = info.IsHD, ServiceName = service.Name, - Url = info.Url, IsMovie = info.IsMovie, IsSeries = info.IsSeries, IsSports = info.IsSports, @@ -221,7 +220,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv IsKids = info.IsKids, IsPremiere = info.IsPremiere, RunTimeTicks = (info.EndDate - info.StartDate).Ticks, - LocationType = recording.LocationType, OriginalAirDate = info.OriginalAirDate, MediaStreams = _itemRepo.GetMediaStreams(new MediaStreamQuery diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 5da6e697db..5781dd69a9 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -50,7 +50,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv private List _channelIdList = new List(); private Dictionary _programs = new Dictionary(); - 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; _fileSystem = fileSystem; @@ -59,6 +59,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv _userManager = userManager; _libraryManager = libraryManager; _mediaEncoder = mediaEncoder; + _taskManager = taskManager; _userDataManager = userDataManager; _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)); } - 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); } + if (query.Status.HasValue) + { + var val = query.Status.Value; + recordings = recordings.Where(i => (i.Status == val)); + } + if (!string.IsNullOrEmpty(query.SeriesTimerId)) { var guid = new Guid(query.SeriesTimerId); diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 27f874cb0a..3681209e77 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -291,7 +291,7 @@ namespace MediaBrowser.ServerApplication await RegisterMediaEncoder(innerProgress).ConfigureAwait(false); 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); var displayPreferencesTask = Task.Run(async () => await ConfigureDisplayPreferencesRepositories().ConfigureAwait(false));