make it better

This commit is contained in:
Isaac Grynsztein
2020-02-24 07:28:11 -05:00
parent 6e311d46a6
commit 8629e6ae9e
3 changed files with 10 additions and 4 deletions

View File

@@ -758,9 +758,9 @@ app.post('/downloadFile', async (req, res) => {
let file = null; let file = null;
if (!is_playlist) { if (!is_playlist) {
if (type === 'audio') { if (type === 'audio') {
file = __dirname + '/' + 'audio/' + fileNames + '.mp3'; file = __dirname + '/' + audioFolderPath + fileNames + '.mp3';
} else if (type === 'video') { } else if (type === 'video') {
file = __dirname + '/' + 'video/' + fileNames + '.mp4'; file = __dirname + '/' + videoFolderPath + fileNames + '.mp4';
} }
} else { } else {
file = await createPlaylistZipFile(fileNames, type, outputName); file = await createPlaylistZipFile(fileNames, type, outputName);

6
db.json Normal file
View File

@@ -0,0 +1,6 @@
{
"playlists": {
"audio": [],
"video": []
}
}

View File

@@ -4,13 +4,13 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "node backend/app.js", "start": "cd backend && node app.js",
"build": "ng build", "build": "ng build",
"test": "ng test", "test": "ng test",
"lint": "ng lint", "lint": "ng lint",
"e2e": "ng e2e", "e2e": "ng e2e",
"electron": "ng build --base-href ./ && electron .", "electron": "ng build --base-href ./ && electron .",
"postinstall": "ng build --prod && mkdir dist/backend && mkdir dist/backend/config && mkdir dist/backend/audio && mkdir dist/backend/video && cp src/assets/default.json dist/backend/config/default.json && cp backend/app.js dist/backend/app.js && cp backend/package.json dist/backend/package.json && npm --prefix dist/backend install dist/backend" "postinstall": "ng build --prod && mkdir dist/backend && mkdir dist/backend/config && mkdir dist/backend/audio && mkdir dist/backend/video && cp src/assets/default.json dist/backend/config/default.json && cp backend/app.js dist/backend/app.js && cp backend/package.json dist/backend/package.json && cd dist/backend && npm install"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {