fix up the logging
This commit is contained in:
parent
18dd8585e9
commit
1bd807e3d7
|
@ -211,7 +211,7 @@ input {
|
||||||
font-size: large;
|
font-size: large;
|
||||||
border-radius: 10px 10px 0px 0px;
|
border-radius: 10px 10px 0px 0px;
|
||||||
transition: 0.1s border-left ease-out, 0.1s background-color ease-in-out;
|
transition: 0.1s border-left ease-out, 0.1s background-color ease-in-out;
|
||||||
height: 96px;
|
min-height: 96px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
@ -423,12 +423,10 @@ input:checked + .slider:before {
|
||||||
#progress-state {
|
#progress-state {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
max-height: 50px;
|
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
overflow: auto;
|
width: 80%;
|
||||||
width: 60%;
|
padding: 6px;
|
||||||
margin-top: 5px;
|
height: 110px;
|
||||||
padding: 2px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.album-downloading {
|
.album-downloading {
|
||||||
|
|
|
@ -41,7 +41,7 @@ function getWebsocketLocation() {
|
||||||
|
|
||||||
function addlog(log, text) {
|
function addlog(log, text) {
|
||||||
log += `<br>${text}`;
|
log += `<br>${text}`;
|
||||||
log = log.split('<br>').slice(-3).join('<br>');
|
log = log.split('<br>').slice(-5).join('<br>');
|
||||||
if (log.startsWith('<br>')) log = log.replace('<br>', '');
|
if (log.startsWith('<br>')) log = log.replace('<br>', '');
|
||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,8 @@ function startDownload(id, isAlbum) {
|
||||||
download(d.data);
|
download(d.data);
|
||||||
} else if (d.key === 'finishDownload') {
|
} else if (d.key === 'finishDownload') {
|
||||||
log = addlog(log, 'Download finished');
|
log = addlog(log, 'Download finished');
|
||||||
|
} else if (d.key === 'zipping') {
|
||||||
|
log = addlog(log, 'Zipping up files');
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('progress-album').innerHTML = `
|
document.getElementById('progress-album').innerHTML = `
|
||||||
|
|
|
@ -121,6 +121,8 @@ app.ws('/api/album', async (ws, req) => {
|
||||||
|
|
||||||
await deemixDownloader.start();
|
await deemixDownloader.start();
|
||||||
|
|
||||||
|
await ws.send(JSON.stringify({key: 'zipping'}));
|
||||||
|
|
||||||
const folderName = trackpaths[0].split('/').slice(-2)[0];
|
const folderName = trackpaths[0].split('/').slice(-2)[0];
|
||||||
try {
|
try {
|
||||||
await promisify(exec)(`zip -0rD "data/${folderName}.zip" "data/${folderName}"`);
|
await promisify(exec)(`zip -0rD "data/${folderName}.zip" "data/${folderName}"`);
|
||||||
|
|
Loading…
Reference in New Issue