chore: clean up rating display

This commit is contained in:
Cory Dransfeldt 2024-10-12 22:46:48 -07:00
parent adccf0ffcc
commit ada27f0858
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View file

@ -96,7 +96,7 @@ SELECT
'subtext', 'subtext',
CASE CASE
WHEN b.star_rating IS NOT NULL WHEN b.star_rating IS NOT NULL
THEN CONCAT('(', b.star_rating, ')') THEN b.star_rating
ELSE NULL ELSE NULL
END END
) AS grid, ) AS grid,

View file

@ -23,8 +23,8 @@ SELECT
'backdrop', CONCAT('/', df2.filename_disk), 'backdrop', CONCAT('/', df2.filename_disk),
'alt', CONCAT(m.title, ' (', m.year, ')'), 'alt', CONCAT(m.title, ' (', m.year, ')'),
'subtext', CASE 'subtext', CASE
WHEN m.star_rating IS NOT NULL THEN CONCAT(m.year, ' (', m.star_rating, ')') WHEN m.star_rating IS NOT NULL THEN CONCAT(m.star_rating, ' (', m.year, ')')
ELSE m.year::TEXT ELSE CONCAT('(', m.year, ')')
END END
) AS grid, ) AS grid,
@ -102,7 +102,7 @@ SELECT
) AS related_movies, ) AS related_movies,
CASE CASE
WHEN m.star_rating IS NOT NULL AND m.last_watched IS NOT NULL THEN WHEN m.star_rating IS NOT NULL AND m.last_watched IS NOT NULL THEN
json_build_object( json_build_object(
'title', m.title, 'title', m.title,
'url', CONCAT('https://coryd.dev/movies/', m.slug), 'url', CONCAT('https://coryd.dev/movies/', m.slug),