Removed all instances of res.end() as it caused errors on debian-based systems and is a redundant call

pull/184/head
Isaac Abadi 5 years ago
parent c1c57135ba
commit c800308b9d

@ -1898,8 +1898,6 @@ app.post('/api/tomp3', optionalJwt, async function(req, res) {
} else { } else {
res.sendStatus(500); res.sendStatus(500);
} }
res.end("yes");
}); });
app.post('/api/tomp4', optionalJwt, async function(req, res) { app.post('/api/tomp4', optionalJwt, async function(req, res) {
@ -1929,8 +1927,6 @@ app.post('/api/tomp4', optionalJwt, async function(req, res) {
} else { } else {
res.sendStatus(500); res.sendStatus(500);
} }
res.end("yes");
}); });
// gets the status of the mp3 file that's being downloaded // gets the status of the mp3 file that's being downloaded
@ -1950,9 +1946,7 @@ app.post('/api/fileStatusMp3', function(req, res) {
percent = downloaded/size; percent = downloaded/size;
exists = ["failed", getFileSizeMp3(name), percent]; exists = ["failed", getFileSizeMp3(name), percent];
} }
//logger.info(exists + " " + name);
res.send(exists); res.send(exists);
res.end("yes");
}); });
// gets the status of the mp4 file that's being downloaded // gets the status of the mp4 file that's being downloaded
@ -1970,9 +1964,7 @@ app.post('/api/fileStatusMp4', function(req, res) {
percent = downloaded/size; percent = downloaded/size;
exists = ["failed", getFileSizeMp4(name), percent]; exists = ["failed", getFileSizeMp4(name), percent];
} }
//logger.info(exists + " " + name);
res.send(exists); res.send(exists);
res.end("yes");
}); });
// gets all download mp3s // gets all download mp3s
@ -2463,7 +2455,6 @@ app.post('/api/deleteMp3', optionalJwt, async (req, res) => {
db.get('files.audio').remove({uid: uid}).write(); db.get('files.audio').remove({uid: uid}).write();
wasDeleted = true; wasDeleted = true;
res.send(wasDeleted); res.send(wasDeleted);
res.end("yes");
} else if (audio_obj) { } else if (audio_obj) {
db.get('files.audio').remove({uid: uid}).write(); db.get('files.audio').remove({uid: uid}).write();
wasDeleted = true; wasDeleted = true;
@ -2495,7 +2486,6 @@ app.post('/api/deleteMp4', optionalJwt, async (req, res) => {
db.get('files.video').remove({uid: uid}).write(); db.get('files.video').remove({uid: uid}).write();
// wasDeleted = true; // wasDeleted = true;
res.send(wasDeleted); res.send(wasDeleted);
res.end("yes");
} else if (video_obj) { } else if (video_obj) {
db.get('files.video').remove({uid: uid}).write(); db.get('files.video').remove({uid: uid}).write();
wasDeleted = true; wasDeleted = true;
@ -2503,7 +2493,6 @@ app.post('/api/deleteMp4', optionalJwt, async (req, res) => {
} else { } else {
wasDeleted = false; wasDeleted = false;
res.send(wasDeleted); res.send(wasDeleted);
res.end("yes");
} }
}); });

Loading…
Cancel
Save