diff options
| author | crobibero <cody@robibe.ro> | 2020-11-06 14:46:21 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-11-06 14:46:21 -0700 |
| commit | 9056908bc776a4a8b3f02c294311a24a7c38a331 (patch) | |
| tree | a0b3956f02a56c27691ee9f8e9340f47d7d186ad /Jellyfin.Server.Implementations/Activity/ActivityManager.cs | |
| parent | d42bb515ce3692abd9295008872c7f9d62b47652 (diff) | |
| parent | 4a5651e5b2fb8e483cabae4443f327f1cdf70b92 (diff) | |
Merge remote-tracking branch 'upstream/master' into video-resolver
Diffstat (limited to 'Jellyfin.Server.Implementations/Activity/ActivityManager.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Activity/ActivityManager.cs | 12 |
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 |
