From 5abf396d805595879dee19b6b7917a247dc3516c Mon Sep 17 00:00:00 2001 From: DariusIII Date: Fri, 26 Dec 2025 12:15:23 +0100 Subject: [PATCH] Reprocess newest releases first --- app/Console/Commands/ReprocessUnmatchedTvReleases.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/ReprocessUnmatchedTvReleases.php b/app/Console/Commands/ReprocessUnmatchedTvReleases.php index 1b1603191..1bddb6932 100644 --- a/app/Console/Commands/ReprocessUnmatchedTvReleases.php +++ b/app/Console/Commands/ReprocessUnmatchedTvReleases.php @@ -47,12 +47,13 @@ class ReprocessUnmatchedTvReleases extends Command $debug = (bool) $this->option('debug'); $sleep = (int) $this->option('sleep'); - // Build query for unmatched TV releases + // Build query for unmatched TV releases (newest to oldest by adddate, then postdate) $query = Release::query() - ->select(['id', 'guid', 'searchname', 'videos_id', 'tv_episodes_id', 'categories_id']) + ->select(['id', 'guid', 'searchname', 'videos_id', 'tv_episodes_id', 'categories_id', 'adddate', 'postdate']) ->where('videos_id', 0) ->whereBetween('categories_id', [Category::TV_ROOT, Category::TV_OTHER]) - ->orderBy('id', 'desc'); + ->orderBy('adddate', 'desc') + ->orderBy('postdate', 'desc'); $totalCount = (clone $query)->count();