|
|
|
@ -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)
|
|
|
|
|