Skip to content

Commit

Permalink
fix: mark expired by mistake when fetching resources without network
Browse files Browse the repository at this point in the history
  • Loading branch information
kingwingfly committed May 5, 2024
1 parent fb5459e commit ee5ba49
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com

## [Unreleased]

## [0.2.15] - 2024-05-04
## [0.2.15] - 2024-05-06

- utils: remove duplicated status change.
- fix: `fav fetch` will mark all resources as `expired` if no network. This command fetches sets before resources, so the bug only happens when network disconnected after fetching sets successfully, it's rare.

## [0.2.14] - 2024-04-25

Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolver = "2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[workspace.package]
version = "0.2.14"
version = "0.2.15"
authors = ["Louis <836250617@qq.com>"]
description = "Back up your favorite online resources with CLI."
license = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion fav_utils/src/bili/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ impl ResOps for Bili {
res = self.request_proto::<BiliRes>(ApiKind::FetchRes, params, "/data") => {
match res {
Ok(res) => *resource |= res,
Err(_) => resource.on_status(StatusFlags::EXPIRED),
Err(e) if matches!(e, FavCoreError::NetworkError(_)) => Err(e)?,
_ => resource.on_status(StatusFlags::EXPIRED),
}
resource.on_status(StatusFlags::FETCHED);
},
Expand Down

0 comments on commit ee5ba49

Please sign in to comment.