Skip to content

Commit 0333598

Browse files
authored
version 0.5.16 (#68)
* fix: empty queue should result in termination * fix: dot output for small downloads
1 parent 19860c7 commit 0333598

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "queueget",
3-
"version": "0.5.15",
3+
"version": "0.5.16",
44
"description": "Download links from a queue file",
55
"bin": {
66
"qget": "./bin/cli.js",

src/filestack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const newFilestack = (filepath) => {
1919
const unflush = async () => {
2020
try {
2121
const data = (await readFile(filepath)).toString()
22-
return data.split("\n").map((line) => line.trim())
22+
return data.length === 0 ? [] : data.split("\n").map((line) => line.trim())
2323
} catch (err) {
2424
if (err.code !== "ENOENT") {
2525
throw err

src/loader/common.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ const commonload = async ({
114114
contentLoaded += chunk.length
115115

116116
// Console update
117-
if ((contentLoaded / contentLength) * MAX_DOTS > dots) {
117+
const contentLoadedDots = (contentLoaded / contentLength) * MAX_DOTS
118+
while (contentLoadedDots > dots) {
118119
dots++
119120
process.stdout.write(".")
120121
}

0 commit comments

Comments
 (0)