mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 22:28:48 +00:00
attempt a fix (#1929)
This commit is contained in:
parent
ae3634e9d4
commit
9569f56aa5
1 changed files with 5 additions and 5 deletions
|
@ -153,7 +153,7 @@ export default async function jdownloaderProxyHandler(req, res) {
|
||||||
})
|
})
|
||||||
|
|
||||||
const packageStatus = await queryPackages(loginData[4], deviceData[1], loginData[5], {
|
const packageStatus = await queryPackages(loginData[4], deviceData[1], loginData[5], {
|
||||||
"bytesLoaded": false,
|
"bytesLoaded": true,
|
||||||
"bytesTotal": true,
|
"bytesTotal": true,
|
||||||
"comment": false,
|
"comment": false,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
@ -171,13 +171,13 @@ export default async function jdownloaderProxyHandler(req, res) {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
let bytesRemaining = 0;
|
let totalLoaded = 0;
|
||||||
let totalBytes = 0;
|
let totalBytes = 0;
|
||||||
let totalSpeed = 0;
|
let totalSpeed = 0;
|
||||||
packageStatus.forEach(file => {
|
packageStatus.forEach(file => {
|
||||||
totalBytes += file.bytesTotal;
|
totalBytes += file.bytesTotal;
|
||||||
if (file.finished !== true) {
|
if (file.finished !== true) {
|
||||||
bytesRemaining += file.bytesTotal;
|
totalLoaded += file.bytesLoaded;
|
||||||
if (file.speed) {
|
if (file.speed) {
|
||||||
totalSpeed += file.speed;
|
totalSpeed += file.speed;
|
||||||
}
|
}
|
||||||
|
@ -186,11 +186,11 @@ export default async function jdownloaderProxyHandler(req, res) {
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
downloadCount: packageStatus.length,
|
downloadCount: packageStatus.length,
|
||||||
bytesRemaining,
|
bytesRemaining: totalBytes - totalLoaded,
|
||||||
totalBytes,
|
totalBytes,
|
||||||
totalSpeed
|
totalSpeed
|
||||||
};
|
};
|
||||||
|
|
||||||
return res.send(data);
|
return res.send(data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue