mirror of
https://gitlab.com/RemixDev/deemix-js.git
synced 2024-12-29 10:56:18 +00:00
implemented album fallback
This commit is contained in:
parent
c978e9a74c
commit
db67883f90
|
@ -78,7 +78,13 @@ async function generateAlbumItem(dz, id, bitrate, rootArtist){
|
||||||
id = albumAPI.id
|
id = albumAPI.id
|
||||||
} else {
|
} else {
|
||||||
try{
|
try{
|
||||||
albumAPI = await dz.api.get_album(id)
|
let albumAPI_gw_page = await dz.gw.get_album_page(id)
|
||||||
|
if (albumAPI_gw_page.DATA){
|
||||||
|
id = albumAPI_gw_page.DATA.ALB_ID
|
||||||
|
albumAPI = await dz.api.get_album(id)
|
||||||
|
} else {
|
||||||
|
throw new GenerationError(`https://deezer.com/album/${id}`, "Can't find the album")
|
||||||
|
}
|
||||||
} catch (e){
|
} catch (e){
|
||||||
console.trace(e)
|
console.trace(e)
|
||||||
throw new GenerationError(`https://deezer.com/album/${id}`, e.message)
|
throw new GenerationError(`https://deezer.com/album/${id}`, e.message)
|
||||||
|
|
Loading…
Reference in a new issue