Compare commits
3 Commits
89a729924d
...
fddbafc2d5
Author | SHA1 | Date |
---|---|---|
|
fddbafc2d5 | |
|
63f43013c3 | |
|
e4e0eb23dd |
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.161.1",
|
||||
"version": "1.161.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.161.1",
|
||||
"version": "1.161.2",
|
||||
"description": "All the latest porn releases in one place",
|
||||
"main": "src/app.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -133,7 +133,6 @@ async function fetchIncludedEntities() {
|
|||
SELECT
|
||||
parents.*,
|
||||
json_agg(included_entities ORDER BY included_entities.id) included_children,
|
||||
row_to_json(grandparents) AS parent,
|
||||
(SELECT json_agg(children)
|
||||
FROM entities AS children
|
||||
WHERE children.parent_id = parents.id) children
|
||||
|
@ -141,26 +140,22 @@ async function fetchIncludedEntities() {
|
|||
included_entities
|
||||
LEFT JOIN
|
||||
entities AS parents ON parents.id = included_entities.parent_id
|
||||
LEFT JOIN
|
||||
entities AS grandparents ON grandparents.id = parents.parent_id
|
||||
WHERE
|
||||
included_entities.type = 'channel'
|
||||
GROUP BY
|
||||
parents.id, grandparents.id
|
||||
parents.id
|
||||
), entity_tree as (
|
||||
/* get recursive parents of networks (necessary for scraper resolve) */
|
||||
SELECT to_jsonb(included_per_network) as entity,
|
||||
parent_id,
|
||||
array['parent'] as parent_path,
|
||||
0 as depth
|
||||
array['parent'] as parent_path
|
||||
FROM included_per_network
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT jsonb_set(entity_tree.entity, entity_tree.parent_path, to_jsonb(entities)),
|
||||
entities.parent_id,
|
||||
entity_tree.parent_path || array['parent'],
|
||||
depth + 1
|
||||
entity_tree.parent_path || array['parent']
|
||||
FROM entity_tree
|
||||
JOIN entities ON entity_tree.parent_id = entities.id
|
||||
)
|
||||
|
@ -185,8 +180,7 @@ async function fetchReleaseEntities(baseReleases) {
|
|||
WITH RECURSIVE entity_tree as (
|
||||
SELECT to_jsonb(entities) as entity,
|
||||
parent_id,
|
||||
array['parent'] as parent_path,
|
||||
0 as depth
|
||||
array['parent'] as parent_path
|
||||
FROM entities
|
||||
WHERE slug = ANY(:entitySlugs)
|
||||
|
||||
|
@ -194,8 +188,7 @@ async function fetchReleaseEntities(baseReleases) {
|
|||
|
||||
SELECT jsonb_set(entity_tree.entity, entity_tree.parent_path, to_jsonb(entities)),
|
||||
entities.parent_id,
|
||||
entity_tree.parent_path || array['parent'],
|
||||
depth + 1
|
||||
entity_tree.parent_path || array['parent']
|
||||
FROM entity_tree
|
||||
JOIN entities ON entity_tree.parent_id = entities.id
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue