chore: fix related books + deduplication
- fixed total plays formatting - formatted queries - improved proxy server
This commit is contained in:
parent
ab50866bb8
commit
d2c4c78ff7
40 changed files with 985 additions and 1357 deletions
|
@ -7,30 +7,20 @@ SELECT
|
|||
l.link,
|
||||
a.mastodon,
|
||||
a.name,
|
||||
json_build_object(
|
||||
'name', a.name,
|
||||
'url', a.url,
|
||||
'mastodon', a.mastodon
|
||||
) AS author,
|
||||
json_build_object('name', a.name, 'url', a.url, 'mastodon', a.mastodon) AS author,
|
||||
'link' AS type,
|
||||
|
||||
(
|
||||
SELECT array_agg(t.name)
|
||||
FROM links_tags lt
|
||||
(
|
||||
SELECT
|
||||
array_agg(t.name)
|
||||
FROM
|
||||
links_tags lt
|
||||
LEFT JOIN tags t ON lt.tags_id = t.id
|
||||
WHERE lt.links_id = l.id
|
||||
) AS tags,
|
||||
|
||||
json_build_object(
|
||||
'title', CONCAT(l.title, ' via ', a.name),
|
||||
'url', l.link,
|
||||
'description', l.description,
|
||||
'date', l.date
|
||||
) AS feed
|
||||
|
||||
WHERE
|
||||
lt.links_id = l.id) AS tags,
|
||||
json_build_object('title', CONCAT(l.title, ' via ', a.name), 'url', l.link, 'description', l.description, 'date', l.date) AS feed
|
||||
FROM
|
||||
links l
|
||||
JOIN
|
||||
authors a ON l.author = a.id
|
||||
JOIN authors a ON l.author = a.id
|
||||
ORDER BY
|
||||
l.date DESC;
|
||||
l.date DESC;
|
||||
|
||||
|
|
Reference in a new issue