aboutsummaryrefslogtreecommitdiff
path: root/du.js
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-05-09 23:50:03 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-05-09 23:50:03 +0200
commite9c34b2a539052ca82eebc6c1d474d59c6ec6690 (patch)
tree0c831c24f25f6accbb7a046d15a4b8f190a71389 /du.js
parentf2b0c6787996f205bc71c4e059a69b9427672b1d (diff)
downloadlocal-nhentai-e9c34b2a539052ca82eebc6c1d474d59c6ec6690.tar.xz
Add multiple tags selector and speed up doujin stats
Diffstat (limited to 'du.js')
-rw-r--r--du.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/du.js b/du.js
index 947fe81..61cacbc 100644
--- a/du.js
+++ b/du.js
@@ -1,10 +1,10 @@
const child = require("child_process")
-module.exports = dir => {
+module.exports = dirs => {
let res, rej
const prom = new Promise((rs, rj) => [res, rej] = [rs, rj])
- const proc = child.spawn("du", ["-b", "-L", dir])
+ const proc = child.spawn("du", ["-b", "-L", "-c", ...dirs])
let data = ""
proc.stdout.on("data", chunk => {
@@ -13,7 +13,7 @@ module.exports = dir => {
proc.on("close", code => {
if (code == 0)
- res(parseInt(data))
+ res(parseInt(data.split("\n").at(-2)))
else
rej(code)
})