Delete incomplete file if there's a downloading error
authorRemixDev <deezloaderremix@gmail.com>
Thu, 30 Jan 2020 21:02:20 +0000 (22:02 +0100)
committerRemixDev <deezloaderremix@gmail.com>
Thu, 30 Jan 2020 21:02:20 +0000 (22:02 +0100)
app/app.js

index a231f5625e9eb4898c6590a4ce2ad16da16b9fcb..8a277db987a6a4963674f1d9a5dcf75952c6ca59 100644 (file)
@@ -2318,6 +2318,7 @@ io.sockets.on('connection', function (s) {
                try{
                        await downloadingPromise
                }catch(err){
+                       if (fs.existsSync(writePath)) fs.unlinkSync(writePath)
                        if (err==="Track is no longer provided by deezer"){
                                if (track.selectedFormat == 9){
                                        track.filesize.flac = 0