aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-01-15 10:18:31 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-01-15 10:18:31 -0500
commit98b6046f04b2732315b882cf65a1f2e3cbea65ab (patch)
treec937c1b850e56758f2286a2beaa806decfde2918
parentca831ae88aaefb07f98d1a337792ea4af608fed0 (diff)
change IsRecording filter to IsInProgress
-rw-r--r--MediaBrowser.Api/LiveTv/LiveTvService.cs12
-rw-r--r--MediaBrowser.Model/LiveTv/RecordingInfoDto.cs12
-rw-r--r--MediaBrowser.Model/LiveTv/RecordingQuery.cs12
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs2
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs13
-rw-r--r--MediaBrowser.ServerApplication/ApplicationHost.cs2
6 files changed, 28 insertions, 25 deletions
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs
index 20b1af8b2..ba4f0fb10 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 4d56d0ae3..ceb976689 100644
--- a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs
@@ -52,12 +52,6 @@ namespace MediaBrowser.Model.LiveTv
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>
/// <value>The media streams.</value>
@@ -70,12 +64,6 @@ namespace MediaBrowser.Model.LiveTv
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>
public string Overview { get; set; }
diff --git a/MediaBrowser.Model/LiveTv/RecordingQuery.cs b/MediaBrowser.Model/LiveTv/RecordingQuery.cs
index 8f82433cc..1fa9af49b 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; }
/// <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.cs
index 55fa47ff7..1546f8045 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 5da6e697d..5781dd69a 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<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.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 27f874cb0..3681209e7 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));