]> git.lizzy.rs Git - local-nhentai.git/blobdiff - multiple-tags.js
Add multiple tags selector and speed up doujin stats
[local-nhentai.git] / multiple-tags.js
diff --git a/multiple-tags.js b/multiple-tags.js
new file mode 100644 (file)
index 0000000..1e46899
--- /dev/null
@@ -0,0 +1,11 @@
+const fzf = require("./fzf")
+const info = require("./info")
+
+const tags = process.argv.slice(2)
+
+info.doujins()
+       .then(doujins => Object.values(doujins))
+       .then(doujins => doujins.filter(doujin =>
+               tags.every(tag => doujin.tag && doujin.tag.includes(tag))))
+       .then(doujins => doujins.map(doujin => doujin.title))
+       .then(doujins => fzf.doujin(doujins))