forked from DebaucheryLibrarian/traxxx
Added children to deep release entity, removed database dependency from Perfect Gonzo scraper.
This commit is contained in:
@@ -199,7 +199,11 @@ async function fetchReleaseEntities(baseReleases) {
|
||||
FROM entity_tree
|
||||
JOIN entities ON entity_tree.parent_id = entities.id
|
||||
)
|
||||
SELECT entity FROM entity_tree WHERE parent_id is null
|
||||
SELECT jsonb_set(entity, '{children}', to_jsonb(COALESCE(json_agg(children) FILTER (WHERE children.id IS NOT NULL), '[]'))) entity
|
||||
FROM entity_tree
|
||||
LEFT JOIN entities AS children ON children.parent_id = (entity->>'id')::int
|
||||
WHERE entity_tree.parent_id IS NULL
|
||||
GROUP BY entity_tree.entity
|
||||
ORDER BY entity->'type' ASC;
|
||||
`, { entitySlugs });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user