Filtering dateless scenes when showcasing is enabled.

This commit is contained in:
DebaucheryLibrarian 2024-06-04 05:19:36 +02:00
parent 78cb842cf7
commit 4aef570096
1 changed files with 5 additions and 1 deletions

View File

@ -74,7 +74,7 @@ function curateScene(rawScene, assets) {
slug: tag.slug,
name: tag.name,
})),
qualities: rawScene.qualities.sort((qualityA, qualityB) => qualityB - qualityA),
qualities: rawScene.qualities?.sort((qualityA, qualityB) => qualityB - qualityA) || [],
movies: assets.movies.map((movie) => ({
id: movie.id,
slug: movie.slug,
@ -360,6 +360,10 @@ async function queryManticoreSql(filters, options, _reqUser) {
builder.where('scenes.is_showcased', filters.isShowcased);
}
if (filters.isShowcased) {
builder.where('scenes.date', '>', 0);
}
if (!filters.scope || filters.scope === 'latest') {
builder
.where('effective_date', '<=', Math.round(Date.now() / 1000))