diff options
| author | Gary Wilber <Spacetech326@gmail.com> | 2020-11-08 11:51:40 -0800 |
|---|---|---|
| committer | Gary Wilber <Spacetech326@gmail.com> | 2020-11-08 11:51:40 -0800 |
| commit | e6d8c02944ddd83e1219d536abbd372cde432035 (patch) | |
| tree | cd83ca29aa3e03fbd0df5371fc68111e24847b4e /Jellyfin.Api/Controllers/ActivityLogController.cs | |
| parent | a51adec836ae967a827cdddffc5572ef621b69d3 (diff) | |
| parent | 363d41f9435e5dbdc8e933690cff66f89d3808fc (diff) | |
Merge remote-tracking branch 'upstream/master' into library_scan_speed
Diffstat (limited to 'Jellyfin.Api/Controllers/ActivityLogController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/ActivityLogController.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Jellyfin.Api/Controllers/ActivityLogController.cs b/Jellyfin.Api/Controllers/ActivityLogController.cs index a07cea9c0..b429cebec 100644 --- a/Jellyfin.Api/Controllers/ActivityLogController.cs +++ b/Jellyfin.Api/Controllers/ActivityLogController.cs @@ -1,7 +1,7 @@ using System; -using System.Linq; +using System.Threading.Tasks; using Jellyfin.Api.Constants; -using Jellyfin.Data.Entities; +using Jellyfin.Data.Queries; using MediaBrowser.Model.Activity; using MediaBrowser.Model.Querying; using Microsoft.AspNetCore.Authorization; @@ -39,19 +39,19 @@ namespace Jellyfin.Api.Controllers /// <returns>A <see cref="QueryResult{ActivityLogEntry}"/> containing the log entries.</returns> [HttpGet("Entries")] [ProducesResponseType(StatusCodes.Status200OK)] - public ActionResult<QueryResult<ActivityLogEntry>> GetLogEntries( + public async Task<ActionResult<QueryResult<ActivityLogEntry>>> GetLogEntries( [FromQuery] int? startIndex, [FromQuery] int? limit, [FromQuery] DateTime? minDate, [FromQuery] bool? hasUserId) { - var filterFunc = new Func<IQueryable<ActivityLog>, IQueryable<ActivityLog>>( - entries => entries.Where(entry => entry.DateCreated >= minDate - && (!hasUserId.HasValue || (hasUserId.Value - ? entry.UserId != Guid.Empty - : entry.UserId == Guid.Empty)))); - - return _activityManager.GetPagedResult(filterFunc, startIndex, limit); + return await _activityManager.GetPagedResultAsync(new ActivityLogQuery + { + StartIndex = startIndex, + Limit = limit, + MinDate = minDate, + HasUserId = hasUserId + }).ConfigureAwait(false); } } } |
