From e9c34b2a539052ca82eebc6c1d474d59c6ec6690 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Mon, 9 May 2022 23:50:03 +0200 Subject: Add multiple tags selector and speed up doujin stats --- select.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'select.js') diff --git a/select.js b/select.js index 6938749..f8ec511 100644 --- a/select.js +++ b/select.js @@ -1,16 +1,14 @@ -const child = require("child_process") const fzf = require("./fzf") const info = require("./info") ;(async _ => { - const doujins = await info.doujins() const tags = await info.tags() - let doujin, tag - while (!doujin) { - try { tag = await fzf(Object.keys(tags).sort()) } catch { return } - try { doujin = await fzf(Object.values(tags[tag]).sort(), __dirname + "/fzf-previews") } catch {} - } - - child.spawn("firefox", [`file://${process.cwd()}/${doujin}/index.html`]) + do { + try { + tag = await fzf.fzf(Object.keys(tags).sort()) + } catch { + return + } + } while (!await fzf.doujin(Object.values(tags[tag]).sort())) })() -- cgit v1.2.3