The Free Software Media System - Server Backend & API
change IsRecording filter to IsInProgress
Luke Pulverenti98b6046f04b2
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.csindex 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.LiveTvGroupId = 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.csindex 4d56d0ae39..ceb976689d 100644--- a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs+++ b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs@@ -51,12 +51,6 @@ namespace MediaBrowser.Model.LiveTv/// </summary>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>/// Gets or sets the media streams./// </summary>@@ -69,12 +63,6 @@ namespace MediaBrowser.Model.LiveTv/// <value>The path.</value>public string Path { get; set; }- /// <summary>- /// Gets or sets the URL.- /// </summary>- /// <value>The URL.</value>- public string Url { get; set; }-/// <summary>/// Overview of the recording./// </summary>diff --git a/MediaBrowser.Model/LiveTv/RecordingQuery.cs b/MediaBrowser.Model/LiveTv/RecordingQuery.csindex 8f82433cc7..1fa9af49b3 100644--- a/MediaBrowser.Model/LiveTv/RecordingQuery.cs+++ b/MediaBrowser.Model/LiveTv/RecordingQuery.cs@@ -44,10 +44,16 @@ namespace MediaBrowser.Model.LiveTvpublic int? Limit { get; set; }/// <summary>- /// Gets or sets a value indicating whether this instance is recording.+ /// Gets or sets the status./// </summary>- /// <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; }+ /// <value>The status.</value>+ 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>/// Gets or sets the series timer identifier.diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.csindex 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.LiveTvAudio = 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.LiveTvIsKids = info.IsKids,IsPremiere = info.IsPremiere,RunTimeTicks = (info.EndDate - info.StartDate).Ticks,- LocationType = recording.LocationType,OriginalAirDate = info.OriginalAirDate,MediaStreams = _itemRepo.GetMediaStreams(new MediaStreamQuerydiff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.csindex 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.LiveTvprivate List<Guid> _channelIdList = new List<Guid>();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;_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.LiveTvrecordings = 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.csindex 27f874cb0a..3681209e77 100644--- a/MediaBrowser.ServerApplication/ApplicationHost.cs+++ b/MediaBrowser.ServerApplication/ApplicationHost.cs@@ -291,7 +291,7 @@ namespace MediaBrowser.ServerApplicationawait 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));