From f497dd5581358fc6e8fdd895500eea4141dd1519 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 23 Aug 2024 09:06:06 +0200 Subject: fix(storage/downloader): Sort the next videos to be downloaded like in the selection file --- src/storage/video_database/downloader.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/storage/video_database') 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> { 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 -- cgit 1.4.1