fix: several small fixes
This commit is contained in:
@@ -580,8 +580,10 @@ impl MediaRepository for OnlineRepository {
|
||||
}
|
||||
}
|
||||
|
||||
// Request image fields for list views (People only needed in get_item detail view)
|
||||
endpoint.push_str("&Fields=BackdropImageTags,ParentBackdropImageTags");
|
||||
// Request image fields for list views (People only needed in get_item
|
||||
// detail view). Genres is needed so cached items carry their genres,
|
||||
// which lets the offline store derive genre lists + per-genre counts.
|
||||
endpoint.push_str("&Fields=BackdropImageTags,ParentBackdropImageTags,Genres");
|
||||
|
||||
let response: ItemsResponse = self.get_json(&endpoint).await?;
|
||||
|
||||
@@ -854,10 +856,17 @@ impl MediaRepository for OnlineRepository {
|
||||
.collect();
|
||||
|
||||
let with_counts = genres.iter().filter(|g| g.album_count.is_some()).count();
|
||||
log::debug!(
|
||||
"get_genres: {} genres, {} carry counts (AlbumCount/ChildCount)",
|
||||
// TEMP DIAGNOSTIC: dump the first few genres with their counts so we can
|
||||
// see whether the server populates any count field. Remove once known.
|
||||
log::warn!(
|
||||
"get_genres: {} genres, {} carry counts. sample: {:?}",
|
||||
genres.len(),
|
||||
with_counts
|
||||
with_counts,
|
||||
genres
|
||||
.iter()
|
||||
.take(8)
|
||||
.map(|g| (g.name.as_str(), g.album_count))
|
||||
.collect::<Vec<_>>()
|
||||
);
|
||||
|
||||
Ok(genres)
|
||||
@@ -890,8 +899,9 @@ impl MediaRepository for OnlineRepository {
|
||||
}
|
||||
}
|
||||
|
||||
// Request image fields for list views (People only needed in get_item detail view)
|
||||
endpoint.push_str("&Fields=BackdropImageTags,ParentBackdropImageTags");
|
||||
// Request image fields for list views (plus Genres so cached items
|
||||
// carry genres for offline genre lists/counts).
|
||||
endpoint.push_str("&Fields=BackdropImageTags,ParentBackdropImageTags,Genres");
|
||||
|
||||
let response: ItemsResponse = self.get_json(&endpoint).await?;
|
||||
Ok(SearchResult {
|
||||
|
||||
Reference in New Issue
Block a user