- 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:
@@ -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']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user