Skip to content

Commit

Permalink
feature/from_archives: fix status bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kingwingfly committed Jun 18, 2024
1 parent d1927a4 commit 9230469
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions fav_utils/src/bili/res.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ impl BitOrAssign for BiliSets {
let mut cache = vec![];
rhs.list
.into_iter()
.for_each(|s| match self.iter_mut().find(|s1| s1.id == s.id) {
.for_each(|mut s| match self.iter_mut().find(|s1| s1.id == s.id) {
Some(s1) => {
if s.media_count == 0
&& !s1.check_status(StatusFlags::EXPIRED)
&& s.title == "该合集已失效"
{
s1.title += "(已失效)";
s1.on_status(StatusFlags::EXPIRED);
} else {
if s.media_count != 0 && s.title != "该合集已失效" {
s1.title = s.title;
s1.media_count = s.media_count;
s1.off_status(StatusFlags::EXPIRED);
} else if !s1.check_status(StatusFlags::EXPIRED) {
s1.title += "(已失效)";
s1.on_status(StatusFlags::EXPIRED);
}
}
None => {
if s.media_count == 0 && s.title == "该合集已失效" {
s.on_status(StatusFlags::EXPIRED);
}
cache.push(s)
}
None => cache.push(s),
});
self.list.extend(cache);
}
Expand Down

0 comments on commit 9230469

Please sign in to comment.