fixed cover fetching on certain albums

looks like deezer likes to return null on cover urls for no fucking reason
thanks baguette devs
This commit is contained in:
uh wot 2021-06-06 00:57:11 +02:00
parent 995645dcb5
commit cedcae8900
Signed by: uhwot
GPG Key ID: CB2454984587B781
2 changed files with 5 additions and 4 deletions

4
dist/worker.js vendored

File diff suppressed because one or more lines are too long

View File

@ -152,8 +152,9 @@ async function track(id, format, access_token, tagging) {
id3.setFrame('TDAT', split[2]+split[1]) id3.setFrame('TDAT', split[2]+split[1])
} }
if (json.album.cover_xl !== undefined) { if (json.md5_image !== "") {
const cover = await fetch(json.album.cover_xl) const url = `https://cdns-images.dzcdn.net/images/cover/${json.md5_image}/1000x1000-000000-80-0-0.jpg`
const cover = await fetch(url)
const coverBuffer = await cover.arrayBuffer() const coverBuffer = await cover.arrayBuffer()
id3.setFrame('APIC', { id3.setFrame('APIC', {