aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Activity/ActivityManager.cs
diff options
context:
space:
mode:
authorBaronGreenback <jimcartlidge@yahoo.co.uk>2020-11-04 20:17:41 +0000
committerGitHub <noreply@github.com>2020-11-04 20:17:41 +0000
commitec245dce9074bd4fa64f1252f62d355e9185696c (patch)
tree97f9fe31f10d42e167f6502bc1227a3006fec912 /Jellyfin.Server.Implementations/Activity/ActivityManager.cs
parentf06e4826c764c1214478a741b0f93315a8bba76b (diff)
parentad262fe8a65137b1678508435054be50b053f217 (diff)
Merge branch 'master' into NetworkPR2
Diffstat (limited to 'Jellyfin.Server.Implementations/Activity/ActivityManager.cs')
-rw-r--r--Jellyfin.Server.Implementations/Activity/ActivityManager.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs
index 5926abfe0..7bde4f35b 100644
--- a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs
+++ b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs
@@ -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