Fix #249
authorRemixDev <deezloaderremix@gmail.com>
Sat, 16 Mar 2019 17:52:04 +0000 (18:52 +0100)
committerRemixDev <deezloaderremix@gmail.com>
Sat, 16 Mar 2019 17:52:04 +0000 (18:52 +0100)
app/app.js
app/public/js/frontend.js

index acfa7ba298a0de97e3ed579bc5e544740a559613..0f9c4eb7c6d0547125bd99f1b98928b8a7dc322c 100644 (file)
@@ -1442,7 +1442,7 @@ io.sockets.on('connection', function (s) {
                // Generating file path
                let filepath = mainFolder;
                let artistPath;
-               if (settings.createArtistFolder || settings.createAlbumFolder) {
+               if ((settings.createArtistFolder || settings.createAlbumFolder) && !settings.plName) {
 
                        if(settings.plName){
                                filepath += antiDot(fixName(settings.plName)) + path.sep;
@@ -1541,7 +1541,7 @@ io.sockets.on('connection', function (s) {
                // Get Artist Image
                if (parseInt(track.id)>0 && track.album.artist.pictureUrl && settings.saveArtworkArtist) {
                        let imgPath;
-                       if(settings.createArtistFolder){
+                       if(settings.createArtistFolder && artistPath){
                                imgPath = artistPath + antiDot(settingsRegexArtistCover(settings.artistImageTemplate,track.album.artist.name))+(settings.PNGcovers ? ".png" : ".jpg");
                                if(!fs.existsSync(imgPath)){
                                        try{
index c72cc4cfc2cca632c87e51250a67677dcc92e7fb..515db156cde7e0b95da8e1261e9be44682221b50 100644 (file)
@@ -1145,7 +1145,7 @@ socket.on("emptyDownloadQueue", function () {
 socket.on("cancelDownload", function (data) {
        //data.queueId          -> queueId of item which was canceled
        $('#' + data.queueId).addClass('animated fadeOutRight').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
-               downloadQueue.splice( list.indexOf(data.id), 1)
+               downloadQueue.splice( downloadQueue.indexOf(data.id), 1)
                $(this).remove()
                if (!data.cleanAll) M.toast({html: '<i class="material-icons left">clear</i>One download removed!', displayLength: 5000, classes: 'rounded'})
        })
@@ -1153,7 +1153,7 @@ socket.on("cancelDownload", function (data) {
 
 $('#clearTracksTable').click(function (ev) {
        $('#tab_downloads_table_downloads').find('tbody').find('.finished, .error').addClass('animated fadeOutRight').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
-               downloadQueue.splice( list.indexOf($(this).data('deezerid')), 1)
+               downloadQueue.splice( downloadQueue.indexOf($(this).data('deezerid')), 1)
                $(this).remove()
        })
        return false
@@ -1164,7 +1164,7 @@ $('#cancelAllTable').click(function (ev) {
                return $(i).attr('id')
        }).get()
        listOfIDs.forEach(function(x){
-               downloadQueue.splice( list.indexOf(x), 1)
+               downloadQueue.splice( listOfIDs.indexOf(x), 1)
        })
        socket.emit('cancelAllDownloads', {queueList: listOfIDs})
 })