diff options
-rw-r--r-- | src/storage/video_database/downloader.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/storage/video_database/downloader.rs b/src/storage/video_database/downloader.rs index a7f6cad..c2c148d 100644 --- a/src/storage/video_database/downloader.rs +++ b/src/storage/video_database/downloader.rs @@ -24,12 +24,13 @@ use super::{ExtractorHash, Video}; pub async fn get_next_uncached_video(app: &App) -> Result<Option<Video>> { let status = VideoStatus::Watch.as_db_integer(); + // NOTE: The ORDER BY statement should be the same as the one in [`getters::get_videos`].<2024-08-22> let result = query!( r#" SELECT * FROM videos WHERE status = ? AND cache_path IS NULL - ORDER BY priority ASC + ORDER BY priority DESC, publish_date DESC LIMIT 1; "#, status |