allows for duplicate tag names (such as if you have the same source pic, but cropped differently)

master
mrq 2022-10-06 01:29:38 +07:00
parent d8f048c6f1
commit 7856f7fae7
1 changed files with 3 additions and 6 deletions

@ -52,9 +52,8 @@ let parse = async () => {
let md5 = file.match(/^([a-f0-9]{32})/);
if ( !md5 ) continue;
md5 = md5[1];
let ext = file.split(".").pop()
console.log(`[${100.0 * i / files.length}%]: ${md5}`);
console.log(`[${(100.0 * i / files.length).toFixed(3)}%]: ${md5}`);
let rateLimit = false;
if ( !cache[md5] ) {
@ -112,8 +111,6 @@ let parse = async () => {
if ( artist ) tags.unshift(artist);
if ( content ) tags.unshift(content);
console.log(tags)
let jointmp = "";
let filtered = [];
for ( let i in tags ) {
@ -124,7 +121,7 @@ let parse = async () => {
let joined = filtered.join(" ")
// NOOOOOO YOU'RE SUPPOSE TO DO IT ASYNCHRONOUSLY SO IT'S NOT BLOCKING
require("fs").copyFileSync(`${config.input}/${file}`, `${config.output}/${joined}.${ext}`)
require("fs").copyFileSync(`${config.input}/${file}`, `${config.output}/${file.replace(md5, joined)}`)
if ( rateLimit && config.rateLimit ) await new Promise( (resolve) => {
setTimeout(resolve, config.rateLimit)