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

Add UserId filter to ActivityLog Entries endpoint
pull/3590/head
Anthony Lavado 4 years ago committed by GitHub
commit f9d4b0a2d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -56,7 +56,10 @@ namespace MediaBrowser.Api.System
DateTime.Parse(request.MinDate, null, DateTimeStyles.RoundtripKind).ToUniversalTime(); DateTime.Parse(request.MinDate, null, DateTimeStyles.RoundtripKind).ToUniversalTime();
var filterFunc = new Func<IQueryable<ActivityLog>, IQueryable<ActivityLog>>( 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); var result = _activityManager.GetPagedResult(filterFunc, request.StartIndex, request.Limit);

Loading…
Cancel
Save