forked from DebaucheryLibrarian/traxxx
Storing serie IDs to manticore scenes table.
This commit is contained in:
parent
8b0b340031
commit
43752cef92
|
@ -23,6 +23,8 @@ const scenesFields = `
|
|||
actors text,
|
||||
tag_ids multi,
|
||||
tags text,
|
||||
movie_ids multi,
|
||||
serie_ids multi,
|
||||
meta text,
|
||||
date timestamp,
|
||||
is_showcased bool,
|
||||
|
|
|
@ -33,7 +33,8 @@ async function fetchScenes() {
|
|||
parents.name as network_name,
|
||||
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.id)) FILTER (WHERE movies.id IS NOT NULL), '[]') as movies,
|
||||
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,
|
||||
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)
|
||||
|
@ -51,7 +52,7 @@ async function fetchScenes() {
|
|||
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
|
||||
GROUP BY
|
||||
releases.id,
|
||||
releases.title,
|
||||
|
@ -95,6 +96,7 @@ async function init() {
|
|||
tag_ids multi,
|
||||
tags text,
|
||||
movie_ids multi,
|
||||
serie_ids multi,
|
||||
meta text,
|
||||
date timestamp,
|
||||
is_showcased bool,
|
||||
|
@ -134,6 +136,7 @@ async function init() {
|
|||
tag_ids: scene.tags.map((tag) => tag.f1),
|
||||
tags: flatTags.join(' '),
|
||||
movie_ids: scene.movies,
|
||||
serie_ids: scene.series,
|
||||
meta: scene.date ? format(scene.date, 'y yy M MMM MMMM d') : undefined,
|
||||
stashed: scene.stashed || 0,
|
||||
},
|
||||
|
|
|
@ -71,7 +71,8 @@ async function updateManticoreSceneSearch(releaseIds) {
|
|||
parents.name as network_name,
|
||||
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.id)) FILTER (WHERE movies.id IS NOT NULL), '[]') as movies,
|
||||
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,
|
||||
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)
|
||||
|
@ -89,7 +90,7 @@ 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
|
||||
${releaseIds ? 'WHERE releases.id = ANY(?)' : ''}
|
||||
GROUP BY
|
||||
releases.id,
|
||||
|
@ -142,6 +143,7 @@ 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,
|
||||
meta: scene.date ? format(scene.date, 'y yy M MMM MMMM d') : undefined,
|
||||
stashed: scene.stashed || 0,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue