From 87f9127d99065423edf8a51c18ec565aa32dbc5c Mon Sep 17 00:00:00 2001 From: Louis <836250617@qq.com> Date: Sat, 24 Feb 2024 17:34:57 +0800 Subject: [PATCH] utils: media count refresh --- CHANGELOG.md | 3 +++ Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- fav_utils/Cargo.toml | 2 +- fav_utils/src/bili/res.rs | 5 ++++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6a00ea..c92dfdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com --> ## [Unreleased] +## [0.2.4] - 2024-02-24 +- Fix: media count not refresh after fetching. + ## [0.2.3] - 2024-02-24 - TryFix: panic when `base_url` not exist. diff --git a/Cargo.lock b/Cargo.lock index 4950d56..c973857 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -347,7 +347,7 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fav" -version = "0.2.3" +version = "0.2.4" dependencies = [ "fav_cli", "tokio", @@ -405,7 +405,7 @@ dependencies = [ [[package]] name = "fav_utils" -version = "0.0.1-beta3" +version = "0.0.1-beta4" dependencies = [ "fav_core", "indicatif", diff --git a/Cargo.toml b/Cargo.toml index 1cba5d9..3116632 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ resolver = "2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [workspace.package] -version = "0.2.3" +version = "0.2.4" authors = ["Louis <836250617@qq.com>"] description = "Back up your favorite online resources with CLI." license = "MIT" @@ -23,7 +23,7 @@ documentation = "" [workspace.dependencies] fav_core = { path = "fav_core", version = "0.0.1-beta5" } fav_derive = { path = "fav_derive", version = "0.0.1-beta1" } -fav_utils = { path = "fav_utils", version = "0.0.1-beta3" } +fav_utils = { path = "fav_utils", version = "0.0.1-beta4" } fav_cli = { path = "fav_cli" } fav_utils_old = { path = "fav_utils_old" } diff --git a/fav_utils/Cargo.toml b/fav_utils/Cargo.toml index 84311cd..2f0ff35 100644 --- a/fav_utils/Cargo.toml +++ b/fav_utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fav_utils" -version = "0.0.1-beta3" +version = "0.0.1-beta4" authors.workspace = true description = "Fav's utils crate; A collection of utilities and data structures for the fav project" license.workspace = true diff --git a/fav_utils/src/bili/res.rs b/fav_utils/src/bili/res.rs index 51ab1e7..a4150bb 100644 --- a/fav_utils/src/bili/res.rs +++ b/fav_utils/src/bili/res.rs @@ -8,7 +8,10 @@ impl BitOrAssign for BiliSets { rhs.list .into_iter() .for_each(|s| match self.iter_mut().find(|s1| s1.id == s.id) { - Some(s1) => *s1 |= s, + Some(s1) => { + s1.media_count = s.media_count; + *s1 |= s + }, None => cache.push(s), }); self.list.extend(cache);