Fixed #75
authorRemixDev <deezloaderremix@gmail.com>
Mon, 4 Nov 2019 13:29:56 +0000 (14:29 +0100)
committerRemixDev <deezloaderremix@gmail.com>
Mon, 4 Nov 2019 13:29:56 +0000 (14:29 +0100)
app/app.js

index ff55fb91e35cbf12c1bb3bc754eeeb581d1a3c3f..7a620a41c8c3cfb7c4eeed1f698245b9fd52be63 100644 (file)
@@ -1549,7 +1549,7 @@ io.sockets.on('connection', function (s) {
                        // Acquiring bpm (only if necessary)
                        if (settings.tags.bpm){
                                logger.info(`[${track.artist.name} - ${track.title}] Getting BPM`);
-                               track.legacyTrack = await s.Deezer.legacyGetTrack(track.id)
+                               if (!track.legacyTrack) track.legacyTrack = await s.Deezer.legacyGetTrack(track.id)
                                try{
                                        track.bpm = track.legacyTrack.bpm
                                }catch(err){
@@ -2033,6 +2033,11 @@ io.sockets.on('connection', function (s) {
                        await downloadingPromise
                }catch(err){
                        if (err==="Track is no longer provided by deezer"){
+                               if (track.selectedFormat == 9){
+                                       track.filesize.flac = 0
+                                       logger.warn(`[${track.artist.name} - ${track.title}] Track is no longer provided by deezer in FLAC, searching for lower bitrate`)
+                                       return downloadTrackObject(track, queueId, settings)
+                               }
                                if(track.fallbackId && track.fallbackId != "0"){
                                        logger.warn(`[${track.artist.name} - ${track.title}] Track is no longer provided by deezer, falling on alternative`)
                                        var _track = await s.Deezer.getTrack(track.fallbackId)