From 8feeb0f858cb71a9a349097f6a84ec3c1e5a1954 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Tue, 3 Sep 2024 06:10:08 +0200 Subject: [PATCH] Added studio info to manticore scenes. --- migrations/20240125011700_manticore.js | 3 +++ seeds/03_studios.js | 4 ++-- src/tools/manticore-scenes.js | 14 +++++++++++++- src/update-search.js | 11 ++++++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/migrations/20240125011700_manticore.js b/migrations/20240125011700_manticore.js index 39cd51d9..980c3109 100644 --- a/migrations/20240125011700_manticore.js +++ b/migrations/20240125011700_manticore.js @@ -18,6 +18,9 @@ const scenesFields = ` network_id int, network_name text, network_slug text, + studio_id int, + studio_name text, + studio_slug text, entity_ids multi, actor_ids multi, actors text, diff --git a/seeds/03_studios.js b/seeds/03_studios.js index 5fc38f98..846df18e 100755 --- a/seeds/03_studios.js +++ b/seeds/03_studios.js @@ -1589,8 +1589,8 @@ const studios = [ parent: 'analvids', }, { - name: 'GOSTOSAS VIDEO ', - slug: 'gostosasvideo', + name: 'Gostosas Video', + slug: 'analvidsgostosasvideo', url: 'https://www.analvids.com/studios/gostosas_video_', parent: 'analvids', description: 'We are a Brazilian Adult Movies Studio. We have been in the industry since 2003. We shoot many types of content such as straight, gay, shemale and more. Contact us at: macellocavalcantti@hotmail.com', diff --git a/src/tools/manticore-scenes.js b/src/tools/manticore-scenes.js index 2a953424..1fb873a3 100644 --- a/src/tools/manticore-scenes.js +++ b/src/tools/manticore-scenes.js @@ -32,6 +32,9 @@ async function fetchScenes() { parents.id as network_id, parents.slug as network_slug, parents.name as network_name, + studios.id as studio_id, + studios.slug as studio_slug, + studios.name as studio_name, 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, @@ -77,6 +80,9 @@ async function fetchScenes() { parents.slug, parents.alias, grandparents.id, + studios.id, + studios.name, + studios.slug, entities.showcased, parents.showcased, studios.showcased; @@ -99,6 +105,9 @@ async function init() { network_id int, network_name text, network_slug text, + studio_id int, + studio_name text, + studio_slug text, entity_ids multi, actor_ids multi, actors text, @@ -143,7 +152,10 @@ async function init() { network_id: scene.network_id || undefined, network_slug: scene.network_slug || undefined, network_name: scene.network_name || undefined, - entity_ids: [scene.channel_id, scene.network_id, scene.parent_network_id].filter(Boolean), // manticore does not support OR, this allows IN + studio_id: scene.studio_id || undefined, + studio_slug: scene.studio_slug || undefined, + studio_name: scene.studio_name || undefined, + entity_ids: [scene.channel_id, scene.network_id, scene.parent_network_id, scene.studio_id].filter(Boolean), // manticore does not support OR, this allows IN actor_ids: scene.actors.map((actor) => actor.f1), actors: scene.actors.map((actor) => actor.f2).join(), tag_ids: scene.tags.map((tag) => tag.f1), diff --git a/src/update-search.js b/src/update-search.js index 50053f59..586e135b 100644 --- a/src/update-search.js +++ b/src/update-search.js @@ -70,6 +70,9 @@ async function updateManticoreSceneSearch(releaseIds) { parents.id as network_id, parents.slug as network_slug, parents.name as network_name, + studios.id as studio_id, + studios.slug as studio_slug, + studios.name as studio_name, 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, @@ -117,6 +120,9 @@ async function updateManticoreSceneSearch(releaseIds) { parents.slug, parents.alias, grandparents.id, + studios.id, + studios.name, + studios.slug, parents.showcased, studios.showcased `, releaseIds && [releaseIds]); @@ -146,7 +152,10 @@ async function updateManticoreSceneSearch(releaseIds) { network_id: scene.network_id || undefined, network_slug: scene.network_slug || undefined, network_name: scene.network_name || undefined, - entity_ids: [scene.channel_id, scene.network_id, scene.parent_network_id].filter(Boolean), // manticore does not support OR, this allows IN + studio_id: scene.studio_id || undefined, + studio_slug: scene.studio_slug || undefined, + studio_name: scene.studio_name || undefined, + entity_ids: [scene.channel_id, scene.network_id, scene.parent_network_id, scene.studio_id].filter(Boolean), // manticore does not support OR, this allows IN actor_ids: scene.actors.map((actor) => actor.f1), actors: scene.actors.map((actor) => actor.f2).join(), tag_ids: scene.tags.map((tag) => tag.f1),