throw proper error for incompatibility on tidal, format qobuz

This commit is contained in:
aria
2024-05-02 07:24:18 -04:00
parent fbccef8399
commit 12c08e665f
2 changed files with 11 additions and 3 deletions

View File

@@ -139,13 +139,14 @@ export default class Qobuz implements StreamerWithLogin {
}
interface RawTrackFileResponse {
url: string
mime_type: string,
mime_type: string
sample: boolean
}
const trackFileResponse = <RawTrackFileResponse>(
await this.#getSigned('track/getFileUrl', params)
)
if (trackFileResponse.sample == true) throw new Error('Could not get non-sample file. Check your token.')
if (trackFileResponse.sample == true)
throw new Error('Could not get non-sample file. Check your token.')
const streamResponse = await fetch(trackFileResponse.url)
return {
mimeType: trackFileResponse.mime_type,