Fixed #280
authorRemixDev <deezloaderremix@gmail.com>
Fri, 3 May 2019 09:50:49 +0000 (11:50 +0200)
committerRemixDev <deezloaderremix@gmail.com>
Fri, 3 May 2019 09:50:49 +0000 (11:50 +0200)
app/app.js
app/public/js/frontend.js

index fe3c43b6849a5446a7227dadb7f47e964f6b1e96..423e5ce6a0b5d8e7399a4581d2030699b59d1269 100644 (file)
@@ -939,6 +939,7 @@ io.sockets.on('connection', function (s) {
                                                downloading.downloaded++
                                        }catch(err){
                                                logger.error(`[${downloading.obj.artist.name} - ${downloading.obj.title}] ${err}`)
+                                               downloading.errorLog += `${t.id} | ${t.artist.name} - ${t.title} | ${err}\r\n`
                                                downloading.failed++
                                        }
                                        io.sockets.emit("updateQueue", {
@@ -950,6 +951,7 @@ io.sockets.on('connection', function (s) {
                                                queueId: downloading.queueId,
                                                id: downloading.id,
                                                type: downloading.type,
+                                               errorLog: downloading.errorLog,
                                        })
                                        io.sockets.emit("downloadProgress", {
                                                queueId: downloading.queueId,
@@ -1029,6 +1031,7 @@ io.sockets.on('connection', function (s) {
                                                                queueId: downloading.queueId,
                                                                id: downloading.id,
                                                                type: downloading.type,
+                                                               errorLog: downloading.errorLog,
                                                        })
                                                        if (downloading.downloaded + downloading.failed >= downloading.size) resolve()
                                                        cb()
@@ -1107,6 +1110,7 @@ io.sockets.on('connection', function (s) {
                                                                queueId: downloading.queueId,
                                                                id: downloading.id,
                                                                type: downloading.type,
+                                                               errorLog: downloading.errorLog,
                                                        })
                                                        if (downloading.downloaded + downloading.failed >= downloading.size) resolve()
                                                        cb()
@@ -1231,6 +1235,7 @@ io.sockets.on('connection', function (s) {
                                                                queueId: downloading.queueId,
                                                                id: downloading.id,
                                                                type: downloading.type,
+                                                               errorLog: downloading.errorLog,
                                                        })
                                                        if (downloading.downloaded + downloading.failed >= downloading.size) resolve()
                                                        cb()
index 08bb058936e6799c5c2925d1c8e93ba87e31d464..31e68d8c1bc731b6cfbf475de4aed288ae8ada46 100644 (file)
@@ -1167,6 +1167,15 @@ socket.on('updateQueue', function (data) {
                $('#' + data.queueId).addClass('error')
                M.toast({html: `<i class="material-icons left">warning</i>${quoteattr(data.name)} - Completed with errors!`, displayLength: 5000, classes: 'rounded'})
        }
+       if (data.errorLog != ""){
+               var errorLog = "<table><tr><th>ID</th><th>Song</th><th>Error</th></tr><tr><td>"
+               errorLog += data.errorLog.split("\r\n").join("</td></tr><tr><td>").split(" | ").join("</td><td>")
+               errorLog = errorLog.slice(0, errorLog.length-8)+"</table>"
+               console.log(errorLog)
+               $('#' + data.queueId).find('.eventBtn').click(()=>{
+                       message(`Errors for ${quoteattr(data.name)}`, errorLog)
+               })
+       }
 })
 
 socket.on("downloadProgress", function (data) {