mirror of
https://codeberg.org/lucida/lucida.git
synced 2026-11-13 23:27:24 -05:00
add isrc lookup to applicable services
This commit is contained in:
@@ -520,4 +520,14 @@ export default class Deezer implements StreamerWithLogin {
|
||||
explicit: userData.USER.EXPLICIT_CONTENT_LEVEL != 'explicit_hide'
|
||||
}
|
||||
}
|
||||
|
||||
async isrcLookup(isrc: string): Promise<Track> {
|
||||
const resp = <{ type?: 'track'; link?: string }>(
|
||||
await (await fetch(`https://api.deezer.com/track/isrc:${isrc}`)).json()
|
||||
)
|
||||
if (resp.type == 'track' && resp.link) {
|
||||
const track = <Track>(await this.getByUrl(resp.link)).metadata
|
||||
return track
|
||||
} else throw new Error(`Not available on Deezer.`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user