Kavita+ Audit Log (#4711)

Co-authored-by: Ansh Raj <anshraj220109+github@proton.me>
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
Co-authored-by: Weblate (bot) <hosted@weblate.org>
Co-authored-by: Adam Havránek <adamhavra@seznam.cz>
Co-authored-by: Gregory.Open <gregory.open@proton.me>
Co-authored-by: Lyrq <lyrq.ku@gmail.com>
Co-authored-by: oxygen44k <iiccpp@outlook.com>
Co-authored-by: Grez Kull <grezkull@users.noreply.hosted.weblate.org>
This commit is contained in:
Joe Milazzo
2026-05-21 08:09:15 -05:00
committed by GitHub
parent 3755116a7e
commit 28f082b653
135 changed files with 9557 additions and 264 deletions
@@ -363,7 +363,7 @@ public static class QueryableExtensions
MatchStateOption.All => query,
MatchStateOption.Matched => query
.Include(s => s.ExternalSeriesMetadata)
.Where(s => s.ExternalSeriesMetadata != null && s.ExternalSeriesMetadata.ValidUntilUtc > DateTime.MinValue && !s.IsBlacklisted),
.WhereMatchedExternalMetadata(),
MatchStateOption.NotMatched => query.
Include(s => s.ExternalSeriesMetadata)
.Where(s => (s.ExternalSeriesMetadata == null || s.ExternalSeriesMetadata.ValidUntilUtc == DateTime.MinValue) && !s.IsBlacklisted && !s.DontMatch),
@@ -373,6 +373,28 @@ public static class QueryableExtensions
};
}
/// <summary>
/// Filters to series that have been successfully matched in Kavita+:
/// has ExternalSeriesMetadata with a populated ValidUntilUtc and is not blacklisted.
/// </summary>
public static IQueryable<Series> WhereMatchedExternalMetadata(this IQueryable<Series> query)
{
return query
.Where(s => !s.IsBlacklisted)
.Where(s => s.ExternalSeriesMetadata != null && s.ExternalSeriesMetadata.ValidUntilUtc > DateTime.MinValue);
}
/// <summary>
/// Filters to series that are matched but whose cached metadata has expired and needs a refresh.
/// A stale series is still considered matched, the data is just out of date.
/// </summary>
public static IQueryable<Series> WhereStaleExternalMetadata(this IQueryable<Series> query)
{
return query
.Where(s => !s.IsBlacklisted)
.Where(s => s.ExternalSeriesMetadata != null && s.ExternalSeriesMetadata!.ValidUntilUtc < DateTime.UtcNow);
}
/// <summary>
/// Filters a sequence to elements where the specified key falls within an inclusive range.
/// </summary>