mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 14:25:17 -04:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user