fixed some unwatch cleanup stuff

This commit is contained in:
Connor Johnstone
2026-03-24 20:41:13 -04:00
parent 45a7dcd8cd
commit 7b14ed593f
6 changed files with 142 additions and 84 deletions
+4 -7
View File
@@ -34,6 +34,7 @@ struct ArtistListItem {
name: String,
musicbrainz_id: Option<String>,
monitored: bool,
enriched: bool,
total_watched: usize,
total_owned: usize,
total_items: usize,
@@ -111,17 +112,12 @@ async fn list_artists(
None
};
let enriched = cached_totals.is_some();
let (total_watched, total_owned, total_items) =
if let Some((avail, watched, owned)) = cached_totals {
(watched as usize, owned as usize, avail as usize)
} else {
// Fall back to wanted item counts
let total_items = artist_wanted.len();
let total_owned = artist_wanted
.iter()
.filter(|w| w.status == WantedStatus::Owned)
.count();
(total_items, total_owned, total_items)
(0, 0, 0)
};
items.push(ArtistListItem {
@@ -129,6 +125,7 @@ async fn list_artists(
name: a.name.clone(),
musicbrainz_id: a.musicbrainz_id.clone(),
monitored: a.monitored,
enriched,
total_watched,
total_owned,
total_items,