Filtering dateless scenes when showcasing is enabled.
This commit is contained in:
parent
78cb842cf7
commit
4aef570096
|
@ -74,7 +74,7 @@ function curateScene(rawScene, assets) {
|
||||||
slug: tag.slug,
|
slug: tag.slug,
|
||||||
name: tag.name,
|
name: tag.name,
|
||||||
})),
|
})),
|
||||||
qualities: rawScene.qualities.sort((qualityA, qualityB) => qualityB - qualityA),
|
qualities: rawScene.qualities?.sort((qualityA, qualityB) => qualityB - qualityA) || [],
|
||||||
movies: assets.movies.map((movie) => ({
|
movies: assets.movies.map((movie) => ({
|
||||||
id: movie.id,
|
id: movie.id,
|
||||||
slug: movie.slug,
|
slug: movie.slug,
|
||||||
|
@ -360,6 +360,10 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||||
builder.where('scenes.is_showcased', filters.isShowcased);
|
builder.where('scenes.is_showcased', filters.isShowcased);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filters.isShowcased) {
|
||||||
|
builder.where('scenes.date', '>', 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (!filters.scope || filters.scope === 'latest') {
|
if (!filters.scope || filters.scope === 'latest') {
|
||||||
builder
|
builder
|
||||||
.where('effective_date', '<=', Math.round(Date.now() / 1000))
|
.where('effective_date', '<=', Math.round(Date.now() / 1000))
|
||||||
|
|
Loading…
Reference in New Issue