Merge pull request #3579 from crobibero/activity-log-userid

Add UserId filter to ActivityLog Entries endpoint
This commit is contained in:
Anthony Lavado 2020-07-18 19:40:30 -04:00 committed by GitHub
commit f9d4b0a2d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,10 @@ namespace MediaBrowser.Api.System
DateTime.Parse(request.MinDate, null, DateTimeStyles.RoundtripKind).ToUniversalTime();
var filterFunc = new Func<IQueryable<ActivityLog>, IQueryable<ActivityLog>>(
entries => entries.Where(entry => entry.DateCreated >= minDate));
entries => entries.Where(entry => entry.DateCreated >= minDate
&& (!request.HasUserId.HasValue || (request.HasUserId.Value
? entry.UserId != Guid.Empty
: entry.UserId == Guid.Empty))));
var result = _activityManager.GetPagedResult(filterFunc, request.StartIndex, request.Limit);