]> git.lizzy.rs Git - local-nhentai.git/blobdiff - select.js
Add multiple tags selector and speed up doujin stats
[local-nhentai.git] / select.js
index 6938749cdaeb166e649688f1341f15eb6fe74635..f8ec511369957050978558b9b7204a6a9decd803 100644 (file)
--- 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()))
 })()