fix(scheduled_shows.sql): sort upcoming shows by air date ascending

This commit is contained in:
Cory Dransfeldt 2025-06-11 16:31:04 -07:00
parent 970061ff9d
commit ca57082f01
No known key found for this signature in database
3 changed files with 9 additions and 4 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "9.2.7", "version": "9.2.8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "coryd.dev", "name": "coryd.dev",
"version": "9.2.7", "version": "9.2.8",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"minisearch": "^7.1.2", "minisearch": "^7.1.2",

View file

@ -1,6 +1,6 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "9.2.7", "version": "9.2.8",
"description": "The source for my personal site. Built using 11ty (and other tools).", "description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module", "type": "module",
"engines": { "engines": {

View file

@ -196,7 +196,12 @@ SELECT json_build_object(
FROM episodes e FROM episodes e
WHERE e.show = s.id WHERE e.show = s.id
) )
ORDER BY s.title ASC ORDER BY (
SELECT MIN(se.air_date)
FROM scheduled_episodes se
WHERE se.show_id = s.id
AND se.status IN ('upcoming', 'aired')
) ASC NULLS LAST
) unstarted ) unstarted
) )
) AS scheduled_shows ) AS scheduled_shows