Selecting deduped results on scene and movie updates pages.
This commit is contained in:
@@ -358,13 +358,14 @@ function curateOptions(options) {
|
||||
return {
|
||||
limit: options?.limit || 30,
|
||||
page: Number(options?.page) || 1,
|
||||
aggregate: options.aggregate ?? true,
|
||||
aggregateYears: (options.aggregate ?? true) && (options.aggregateYears ?? true),
|
||||
aggregateActors: (options.aggregate ?? true) && (options.aggregateActors ?? true),
|
||||
aggregateTags: (options.aggregate ?? true) && (options.aggregateTags ?? true),
|
||||
aggregateChannels: (options.aggregate ?? true) && (options.aggregateChannels ?? true),
|
||||
index: options.index || 'scenes',
|
||||
useSql: options.useSql || (typeof options.useSql === 'undefined' && sqlImplied.includes(options.index)) || false,
|
||||
aggregate: options?.aggregate ?? true,
|
||||
aggregateYears: (options?.aggregate ?? true) && (options?.aggregateYears ?? true),
|
||||
aggregateActors: (options?.aggregate ?? true) && (options?.aggregateActors ?? true),
|
||||
aggregateTags: (options?.aggregate ?? true) && (options?.aggregateTags ?? true),
|
||||
aggregateChannels: (options?.aggregate ?? true) && (options?.aggregateChannels ?? true),
|
||||
dedupe: !!options?.dedupe,
|
||||
index: options?.index || 'scenes',
|
||||
useSql: options?.useSql || (typeof options?.useSql === 'undefined' && sqlImplied.includes(options?.index)) || false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -480,6 +481,10 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||
builder.where('scenes.date', '>', 0);
|
||||
}
|
||||
|
||||
if (options.dedupe) {
|
||||
builder.where('scenes.dupe_index', '<', 2);
|
||||
}
|
||||
|
||||
if (!filters.scope || filters.scope === 'latest') {
|
||||
builder
|
||||
.where('effective_date', '<=', Math.round(Date.now() / 1000))
|
||||
|
||||
Reference in New Issue
Block a user