Kavita+ Overhaul & New Changelog (#3507)
This commit is contained in:
parent
d880c1690c
commit
a5707617f2
249 changed files with 14775 additions and 2300 deletions
|
@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
|||
using API.Data.Misc;
|
||||
using API.Data.Repositories;
|
||||
using API.DTOs.Filtering;
|
||||
using API.DTOs.KavitaPlus.Manage;
|
||||
using API.Entities;
|
||||
using API.Entities.Enums;
|
||||
using API.Entities.Scrobble;
|
||||
|
@ -281,4 +282,17 @@ public static class QueryableExtensions
|
|||
{
|
||||
return sortOptions.IsAscending ? query.OrderBy(keySelector) : query.OrderByDescending(keySelector);
|
||||
}
|
||||
|
||||
public static IQueryable<Series> FilterMatchState(this IQueryable<Series> query, MatchStateOption stateOption)
|
||||
{
|
||||
return stateOption switch
|
||||
{
|
||||
MatchStateOption.All => query,
|
||||
MatchStateOption.Matched => query.Where(s => s.ExternalSeriesMetadata != null && s.ExternalSeriesMetadata.ValidUntilUtc > DateTime.MinValue && !s.IsBlacklisted),
|
||||
MatchStateOption.NotMatched => query.Where(s => (s.ExternalSeriesMetadata == null || s.ExternalSeriesMetadata.ValidUntilUtc == DateTime.MinValue) && !s.IsBlacklisted),
|
||||
MatchStateOption.Error => query.Where(s => s.IsBlacklisted),
|
||||
MatchStateOption.DontMatch => query.Where(s => s.DontMatch),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(stateOption), stateOption, null)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue