From 59e2fca5e21c6f37cf1fc42c597247eaf0cb66bc Mon Sep 17 00:00:00 2001 From: Louis <836250617@qq.com> Date: Sun, 4 Feb 2024 03:47:16 +0800 Subject: [PATCH] fix: clarity does not inherite from list to video --- Cargo.toml | 2 +- src/api/fetch.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5487e97..55d1089 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fav" -version = "0.1.3" +version = "0.1.4" authors = ["Louis <836250617@qq.com>"] description = "Back up your favorite online resources with CLI." license = "MIT" diff --git a/src/api/fetch.rs b/src/api/fetch.rs index 0554d8c..4540132 100644 --- a/src/api/fetch.rs +++ b/src/api/fetch.rs @@ -76,11 +76,11 @@ impl Meta { async fn fetch_videos(&mut self) -> Result<()> { info!("Fetching fave videos tracked"); - for (list_id, count) in self + for (list_id, count, clarity) in self .lists .iter() .filter(|list| list.track) - .map(|list| (list.id, list.media_count)) + .map(|list| (list.id, list.media_count, list.clarity.unwrap())) { for page in 0..=count.saturating_sub(1) / 20 { let url = reqwest::Url::parse_with_params( @@ -111,6 +111,7 @@ impl Meta { video.fav = true; video.expired = video.attr != 0; video.track = true; + video.clarity = clarity.into(); self.videos.push(video); } });