- Added Upkeeping → Correct catalogue order.

It now recalculates video sort_order from created_at newest-first, so 
videos with corrected/original publish dates appear first in the 
homepage and public catalogue. I also updated 
catalogue/admin/latest-video ordering to use publish date as a 
tie-breaker after stored sort order.
This commit is contained in:
Ty Clifford
2026-06-25 11:58:57 -04:00
parent 7375613e63
commit 8a39bc02fa
5 changed files with 66 additions and 5 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ $video = $slug ? get_video_by_slug($slug) : null;
// Latest video as default if none specified
if (!$video) {
$db = get_db();
$latest = $db->query("SELECT slug FROM videos WHERE published=1 ORDER BY sort_order ASC, id DESC LIMIT 1")->fetch();
$latest = $db->query("SELECT slug FROM videos WHERE published=1 ORDER BY sort_order ASC, datetime(created_at) DESC, created_at DESC, id DESC LIMIT 1")->fetch();
if ($latest) $video = get_video_by_slug($latest['slug']);
}