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
|
@ -3,34 +3,17 @@ SELECT
|
|||
c.id,
|
||||
c.date,
|
||||
c.notes,
|
||||
|
||||
CASE
|
||||
WHEN c.artist IS NOT NULL THEN
|
||||
json_build_object(
|
||||
'name', a.name_string,
|
||||
'url', a.slug
|
||||
)
|
||||
ELSE
|
||||
json_build_object(
|
||||
'name', c.artist_name_string,
|
||||
'url', NULL
|
||||
)
|
||||
CASE WHEN c.artist IS NOT NULL THEN
|
||||
json_build_object('name', a.name_string, 'url', a.slug)
|
||||
ELSE
|
||||
json_build_object('name', c.artist_name_string, 'url', NULL)
|
||||
END AS artist,
|
||||
|
||||
json_build_object(
|
||||
'name', v.name,
|
||||
'name_short', trim(split_part(v.name, ',', 1)),
|
||||
'latitude', v.latitude,
|
||||
'longitude', v.longitude,
|
||||
'notes', v.notes
|
||||
) AS venue,
|
||||
|
||||
json_build_object('name', v.name, 'name_short', trim(split_part(v.name, ',', 1)), 'latitude', v.latitude, 'longitude', v.longitude, 'notes', v.notes) AS venue,
|
||||
c.notes AS concert_notes
|
||||
|
||||
FROM
|
||||
concerts c
|
||||
LEFT JOIN artists a ON c.artist = a.id
|
||||
LEFT JOIN venues v ON c.venue = v.id
|
||||
|
||||
ORDER BY
|
||||
c.date DESC;
|
||||
c.date DESC;
|
||||
|
||||
|
|
Reference in a new issue