feat(*): refactor metadata handling; move metadata to backend where possible, refine client views

This commit is contained in:
Cory Dransfeldt 2025-05-25 20:15:45 -07:00
parent 929bc9f9f8
commit 9687509e4a
No known key found for this signature in database
35 changed files with 506 additions and 339 deletions

View file

@ -106,6 +106,20 @@ SELECT
WHERE pg.genres_id = g.id
) AS posts,
json_build_object(
'title', CONCAT('Genre • ', g.name, '', globals.site_name),
'description', LEFT(
regexp_replace(
regexp_replace(
regexp_replace(
g.description,
E'[*_`~#>-]', '', 'g'
),
E'\\[(.*?)\\]\\((.*?)\\)', E'\\1', 'g'
),
E'!\\[(.*?)\\]\\((.*?)\\)', '', 'g'
),
250
),
'open_graph_image', (
SELECT CONCAT('/', df_artist.filename_disk)
FROM artists a
@ -115,7 +129,9 @@ SELECT
AND df_artist.filename_disk != ''
ORDER BY a.total_plays DESC
LIMIT 1
)
),
'url', CONCAT(globals.url, g.slug),
'type', 'genre'
) AS metadata
FROM genres g
CROSS JOIN optimized_globals globals