Merge branch 'master' into NetworkPR2

This commit is contained in:
BaronGreenback
2020-11-04 20:17:41 +00:00
committed by GitHub
63 changed files with 487 additions and 281 deletions

View File

@@ -72,6 +72,18 @@ namespace Jellyfin.Server.Implementations.Activity
};
}
/// <inheritdoc />
public async Task CleanAsync(DateTime startDate)
{
await using var dbContext = _provider.CreateContext();
var entries = dbContext.ActivityLogs
.AsQueryable()
.Where(entry => entry.DateCreated <= startDate);
dbContext.RemoveRange(entries);
await dbContext.SaveChangesAsync().ConfigureAwait(false);
}
private static ActivityLogEntry ConvertToOldModel(ActivityLog entry)
{
return new ActivityLogEntry