This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/queries/views/globals/index.psql
Cory Dransfeldt d2c4c78ff7
chore: fix related books + deduplication
- fixed total plays formatting
- formatted queries
- improved proxy server
2024-10-21 16:30:40 -07:00

22 lines
527 B
Text

CREATE OR REPLACE VIEW optimized_globals AS
SELECT
g.site_name,
g.site_description,
g.intro,
g.author,
g.email,
g.mastodon,
g.url,
g.cdn_url,
g.theme_color,
g.site_type,
g.locale,
g.lang,
g.webfinger_username,
g.webfinger_hostname,
CONCAT('/', df.filename_disk) AS avatar,
CONCAT('/', df2.filename_disk) AS avatar_transparent
FROM
globals g
LEFT JOIN directus_files df ON g.avatar = df.id
LEFT JOIN directus_files df2 ON g.avatar_transparent = df2.id