feat(award): resolve award id by name via /award/explore when /album/get omits it

/album/get's AwardDto has id: String? — Qobuz sometimes returns an
award entry with only a name and no id. Rather than disabling the
click or toasting, we look up the id in the Qobuz award catalog.

- Adds v2_get_award_explore (paginated /award/explore) all the way
  through qbz-qobuz → core → bridge → command → invoke_handler.
- New frontend awardCatalogStore caches the full (id, name) list
  lazily, one fetch per session, resolved on first click that needs
  it. Further clicks are instant.
- handleAwardClick goes straight to navigation when id is present,
  falls back to resolveAwardIdByName otherwise. Toast only fires if
  the name isn't in the catalog either (genuinely unknown award).

cc
This commit is contained in:
vicrodh committed 2026-04-14 15:06:15 -06:00
1 parent 9460838223
commit 854eaaa0a4
8 files changed
+176 -7

No files matched your search

+24
View File
@@ -1477,6 +1477,30 @@ impl QobuzClient {
Ok(serde_json::from_value(response)?)
}
/// Enumerate the award catalog (/award/explore). Paginated.
/// Returns raw JSON items so callers can extract just (id, name).
pub async fn get_award_explore(
&self,
limit: u32,
offset: u32,
) -> Result<serde_json::Value> {
let url = endpoints::build_url(paths::AWARD_EXPLORE);
log::debug!("[API] get_award_explore(limit={}, offset={})", limit, offset);
let response: serde_json::Value = self
.signed_get_auth(
&url,
"awardexplore",
&[
("limit", limit.to_string()),
("offset", offset.to_string()),
],
)
.await?
.json()
.await?;
Ok(response)
}
/// Get award page — hero info + categorized award-winning releases.
/// Mirrors Android's AwardDto shape from /award/page. Uses auth
/// headers (app_id + user token) — region-gated catalog.
+1
View File
@@ -60,6 +60,7 @@ pub mod paths {
// Award
pub const AWARD_PAGE: &str = "/award/page";
pub const AWARD_GET_ALBUMS: &str = "/award/getAlbums";
pub const AWARD_EXPLORE: &str = "/award/explore";
// Genre
pub const GENRE_LIST: &str = "/genre/list";