mirror of
https://gitlab.com/RemixDev/deemix-js.git
synced 2024-12-28 02:16:08 +00:00
Added check for empty single albums
Thanks digitalec
This commit is contained in:
parent
7da4ed4572
commit
5f332f7a88
|
@ -78,7 +78,11 @@ async function generateAlbumItem(dz, id, bitrate, rootArtist){
|
|||
|
||||
// If the album is a single download as a track
|
||||
if (albumAPI.nb_tracks == 1){
|
||||
return generateTrackItem(dz, albumAPI.tracks.data[0].id, bitrate, null, albumAPI)
|
||||
if (albumAPI.tracks.data.length){
|
||||
return generateTrackItem(dz, albumAPI.tracks.data[0].id, bitrate, null, albumAPI)
|
||||
} else {
|
||||
throw new GenerationError(`https://deezer.com/album/${id}`, "Single has no tracks.")
|
||||
}
|
||||
}
|
||||
|
||||
let tracksArray = await dz.gw.get_album_tracks(id)
|
||||
|
|
Loading…
Reference in a new issue