Added movie and serie titles to manticore scenes.

This commit is contained in:
DebaucheryLibrarian
2024-08-29 04:46:21 +02:00
parent 35fc2370f0
commit b1353f3bc3
3 changed files with 21 additions and 7 deletions

View File

@@ -73,8 +73,8 @@ async function updateManticoreSceneSearch(releaseIds) {
grandparents.id as parent_network_id,
COALESCE(JSON_AGG(DISTINCT (actors.id, actors.name)) FILTER (WHERE actors.id IS NOT NULL), '[]') as actors,
COALESCE(JSON_AGG(DISTINCT (tags.id, tags.name, tags.priority, tags_aliases.name)) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags,
COALESCE(JSON_AGG(DISTINCT (movies_scenes.movie_id)) FILTER (WHERE movies_scenes.movie_id IS NOT NULL), '[]') as movies,
COALESCE(JSON_AGG(DISTINCT (series_scenes.serie_id)) FILTER (WHERE series_scenes.serie_id IS NOT NULL), '[]') as series,
COALESCE(JSON_AGG(DISTINCT (movies.id, movies.title)) FILTER (WHERE movies.id IS NOT NULL), '[]') as movies,
COALESCE(JSON_AGG(DISTINCT (series.id, series.title)) FILTER (WHERE series.id IS NOT NULL), '[]') as series,
studios.showcased IS NOT false
AND (entities.showcased IS NOT false OR COALESCE(studios.showcased, false) = true)
AND (parents.showcased IS NOT false OR COALESCE(entities.showcased, false) = true OR COALESCE(studios.showcased, false) = true)
@@ -95,7 +95,9 @@ async function updateManticoreSceneSearch(releaseIds) {
LEFT JOIN tags ON local_tags.tag_id = tags.id
LEFT JOIN tags as tags_aliases ON local_tags.tag_id = tags_aliases.alias_for AND tags_aliases.secondary = true
LEFT JOIN movies_scenes ON movies_scenes.scene_id = releases.id
LEFT JOIN movies ON movies.id = movies_scenes.movie_id
LEFT JOIN series_scenes ON series_scenes.scene_id = releases.id
LEFT JOIN series ON series.id = series_scenes.serie_id
${releaseIds ? 'WHERE releases.id = ANY(?)' : ''}
GROUP BY
releases.id,
@@ -150,7 +152,9 @@ async function updateManticoreSceneSearch(releaseIds) {
tag_ids: scene.tags.map((tag) => tag.f1),
tags: flatTags.join(' '), // only make top tags searchable to minimize cluttered results
movie_ids: scene.movies,
serie_ids: scene.series,
movies: scene.movies.map((movie) => movie.f2).join(' '),
serie_ids: scene.series.map((serie) => serie.f1),
series: scene.series.map((serie) => serie.f2).join(' '),
meta: scene.date ? format(scene.date, 'y yy M MMM MMMM d') : undefined,
stashed: scene.stashed || 0,
},