Compare commits

...

4 Commits

Author SHA1 Message Date
3c47a1b14e 0.47.4 2026-03-05 17:23:31 +01:00
da6ccccab4 Fixed tile tag deduping order. 2026-03-05 17:23:29 +01:00
f79ef53ebd 0.47.3 2026-03-05 16:34:43 +01:00
185984bf0c Fixed actor and channel aggregation duplicates. 2026-03-05 16:34:41 +01:00
4 changed files with 14 additions and 13 deletions

View File

@@ -135,7 +135,8 @@ const { user } = pageContext;
const pageStash = pageContext.pageProps.stash;
const currentStash = pageStash || pageContext.assets?.primaryStash;
const sceneTags = Object.values(Object.fromEntries(props.scene.tags.map((tag) => [tag.id, tag])));
const tagsById = Object.fromEntries(props.scene.tags.map((tag) => [tag.id, tag]));
const sceneTags = Array.from(new Set(props.scene.tags.map((tag) => tag.id))).map((tagId) => tagsById[tagId]);
const priorityTags = sceneTags.map((tag) => tag.name).slice(0, 2);
const favorited = ref(props.scene.stashes.some((sceneStash) => sceneStash.id === currentStash?.id));

4
package-lock.json generated
View File

@@ -1,11 +1,11 @@
{
"name": "traxxx-web",
"version": "0.47.2",
"version": "0.47.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.47.2",
"version": "0.47.4",
"dependencies": {
"@brillout/json-serializer": "^0.5.8",
"@dicebear/collection": "^7.0.5",

View File

@@ -92,7 +92,7 @@
"overrides": {
"vite": "$vite"
},
"version": "0.47.2",
"version": "0.47.4",
"imports": {
"#/*": "./*.js"
}

View File

@@ -564,15 +564,15 @@ async function queryManticoreSql(filters, options, _reqUser) {
.offset((options.page - 1) * options.limit),
// option threads=1 fixes actors, but drastically slows down performance, wait for fix
yearsFacet: options.aggregateYears ? knex.raw('facet effective_year as years order by effective_year desc limit ?', [aggSize]) : null,
actorsFacet: options.aggregateActors ? knex.raw('facet scenes.actor_ids order by count(*) desc limit ?', [aggSize]) : null,
actorsFacet: options.aggregateActors ? knex.raw('facet scenes.actor_ids distinct id order by count(distinct id) desc limit ?', [aggSize]) : null,
// don't facet tags associated to other actors, actor ID 0 means global
tagsFacet: options.aggregateTags // eslint-disable-line no-nested-ternary
? (filters.stashId // we can't join the tags table as well as the stashes table
? knex.raw('facet scenes.tag_ids order by count(*) desc limit ?', [aggSize])
: knex.raw(`facet IF(IN(scenes_tags.actor_id, ${[0, ...filters?.actorIds || []]}), scenes_tags.tag_id, 0) as tags_facet distinct id order by count(distinct id) desc limit ?`, [aggSize]))
: null,
channelsFacet: options.aggregateChannels ? knex.raw('facet scenes.channel_id order by count(*) desc limit ?', [aggSize]) : null,
studiosFacet: options.aggregateChannels ? knex.raw('facet scenes.studio_id order by count(*) desc limit ?', [aggSize]) : null,
channelsFacet: options.aggregateChannels ? knex.raw('facet scenes.channel_id distinct id order by count(distinct id) desc limit ?', [aggSize]) : null,
studiosFacet: options.aggregateChannels ? knex.raw('facet scenes.studio_id distinct id order by count(distinct id) desc limit ?', [aggSize]) : null,
maxMatches: config.database.manticore.maxMatches,
maxQueryTime: config.database.manticore.maxQueryTime,
}).toString();
@@ -598,8 +598,8 @@ async function queryManticoreSql(filters, options, _reqUser) {
|| [];
const actorIds = results
.find((result) => (result.columns[0].actor_ids || result.columns[0]['scenes.actor_ids']) && result.columns[1]['count(*)'])
?.data.map((row) => ({ key: row.actor_ids || row['scenes.actor_ids'], doc_count: row['count(*)'] }))
.find((result) => (result.columns[0].actor_ids || result.columns[0]['scenes.actor_ids']) && result.columns[1]['count(distinct id)'])
?.data.map((row) => ({ key: row.actor_ids || row['scenes.actor_ids'], doc_count: row['count(distinct id)'] }))
|| [];
const tagIds = results
@@ -608,14 +608,14 @@ async function queryManticoreSql(filters, options, _reqUser) {
|| [];
const channelIds = results
.find((result) => (result.columns[0].channel_id || result.columns[0]['scenes.channel_id']) && result.columns[1]['count(*)'])
?.data.map((row) => ({ key: row.channel_id || row['scenes.channel_id'], doc_count: row['count(*)'] }))
.find((result) => (result.columns[0].channel_id || result.columns[0]['scenes.channel_id']) && result.columns[1]['count(distinct id)'])
?.data.map((row) => ({ key: row.channel_id || row['scenes.channel_id'], doc_count: row['count(distinct id)'] }))
|| [];
const studioIds = results
.find((result) => (result.columns[0].studio_id || result.columns[0]['scenes.studio_id']) && result.columns[1]['count(*)'])
.find((result) => (result.columns[0].studio_id || result.columns[0]['scenes.studio_id']) && result.columns[1]['count(distinct id)'])
?.data
.map((row) => ({ key: row.studio_id || row['scenes.studio_id'], doc_count: row['count(*)'] }))
.map((row) => ({ key: row.studio_id || row['scenes.studio_id'], doc_count: row['count(distinct id)'] }))
.filter((row) => !!row.key)
|| [];