fixed some unwatch cleanup stuff
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user