fix(api): Release Watch lives at /favorite/getNewReleases?type=artists
The inferred OpenAPI spec
(qbz-nix-docs/qobuz-api-inferred-openapi-v9.7.0.3.yaml, source:
x20/b.java) documents the endpoint as /favorite/getNewReleases with
three required query params:
@GET favorite/getNewReleases
- type: String (artists | labels | awards — matches the three
tabs in the mobile UI)
- limit: Integer
- offset: Integer
My earlier attempts at /albums/releaseWatch were chasing the Android
route-table entry for the Release Watch *screen*, not the HTTP call
that screen makes. Different layer.
Also removes my made-up speculation about mobile app_id gating — the
/favorite/* endpoints are standard web-API calls the existing client
already knows how to sign (via authenticated_headers + /0.2/ base URL).
v2_get_release_watch now takes an optional releaseType arg defaulting
to 'artists' so callers can switch tabs later without another command.
cc
This commit is contained in:
5 files changed
+39
-31
No files matched your search
@@ -258,14 +258,15 @@ pub async fn v2_get_featured_albums(
|
||||
Ok(results)
|
||||
}
|
||||
|
||||
/// Get Release Watch (V2 — releases from followed artists, labels and awards).
|
||||
/// Get Release Watch (V2 — releases from followed artists/labels/awards).
|
||||
///
|
||||
/// Calls the mobile "Radar de Novedades" endpoint (`/albums/releaseWatch`)
|
||||
/// with authenticated headers (no RPC signing). Runs the result through the
|
||||
/// artist blacklist filter.
|
||||
/// Calls `/favorite/getNewReleases?type=...` — the same endpoint the mobile
|
||||
/// client uses for its "Radar de Novedades" feed. `release_type` defaults to
|
||||
/// `"artists"` (the mobile default tab) and accepts `"labels"` or `"awards"`.
|
||||
#[tauri::command]
|
||||
#[allow(non_snake_case)]
|
||||
pub async fn v2_get_release_watch(
|
||||
releaseType: Option<String>,
|
||||
limit: Option<u32>,
|
||||
offset: Option<u32>,
|
||||
bridge: State<'_, CoreBridgeState>,
|
||||
@@ -277,13 +278,19 @@ pub async fn v2_get_release_watch(
|
||||
.check_requirements(CommandRequirement::RequiresCoreBridgeAuth)
|
||||
.await?;
|
||||
|
||||
let release_type = releaseType.unwrap_or_else(|| "artists".to_string());
|
||||
let limit = limit.unwrap_or(20);
|
||||
let offset = offset.unwrap_or(0);
|
||||
log::info!("[V2] get_release_watch: limit={}, offset={}", limit, offset);
|
||||
log::info!(
|
||||
"[V2] get_release_watch: type={}, limit={}, offset={}",
|
||||
release_type,
|
||||
limit,
|
||||
offset
|
||||
);
|
||||
|
||||
let bridge = bridge.get().await;
|
||||
let mut results = bridge
|
||||
.get_release_watch(limit, offset)
|
||||
.get_release_watch(&release_type, limit, offset)
|
||||
.await
|
||||
.map_err(RuntimeError::Internal)?;
|
||||
|
||||
|
||||
@@ -498,14 +498,15 @@ impl CoreBridge {
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
/// Get Release Watch — releases from followed artists, labels and awards.
|
||||
/// Get Release Watch — releases from followed artists/labels/awards.
|
||||
pub async fn get_release_watch(
|
||||
&self,
|
||||
release_type: &str,
|
||||
limit: u32,
|
||||
offset: u32,
|
||||
) -> Result<SearchResultsPage<Album>, String> {
|
||||
self.core
|
||||
.get_release_watch(limit, offset)
|
||||
.get_release_watch(release_type, limit, offset)
|
||||
.await
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user