Fixed downloadQueue during connection issues
authorRemixDev <deezloaderremix@gmail.com>
Sat, 16 Mar 2019 18:29:16 +0000 (19:29 +0100)
committerRemixDev <deezloaderremix@gmail.com>
Sat, 16 Mar 2019 18:29:16 +0000 (19:29 +0100)
app/public/js/frontend.js

index bdf1eb1920656efce2b389a8a24cdd03fa7cea19..5c1d93495e649f180d78087b0fdbde21fe030be4 100644 (file)
@@ -1092,8 +1092,11 @@ function addObjToQueue(data){
 
 socket.on('addToQueue', function(data){addObjToQueue(data)})
 socket.on('populateDownloadQueue', function(data){
-       Object.keys(data).forEach(function(key) {
-               addObjToQueue(data[key])
+       Object.keys(data).forEach(function(x) {
+               downloadQueue.push(`${data[x].id}:${data[x].bitrate}`)
+               if ($('#' + data[x].queueId).length == 0){
+                       addObjToQueue(data[x])
+               }
        })
 })