aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Activity/ActivityManager.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-11-03 07:05:58 -0700
committercrobibero <cody@robibe.ro>2020-11-03 07:05:58 -0700
commit5d88e610768c8b680096938a372585638ef18fe3 (patch)
tree28cf4327a0cb19d6025f8fd426351becbb80b085 /Jellyfin.Server.Implementations/Activity/ActivityManager.cs
parent0c674b496f3f4503b6d45c763aadc9b1c5d2735d (diff)
parent8fc16043c7c080afd31f67798b74ccdf62eb583c (diff)
Merge remote-tracking branch 'upstream/master' into livetv-ts-fix
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