diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2020-10-17 09:47:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-17 09:47:20 +0100 |
| commit | 38da2ee26efb45ab8afc8aa692686ffe316a4ace (patch) | |
| tree | 6b5a05b7a437bbb53da78062e869daa220a51762 /Jellyfin.Api/Controllers/ActivityLogController.cs | |
| parent | ee976bb47abe2f16b7d27cd2f789264c5a9ec8d0 (diff) | |
| parent | 86090ab1f65c66958c897cacd04221c537053eb3 (diff) | |
Merge branch 'master' into update-plugin
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); } } } |
