1
0
Fork 0

Fixed issue with too many tags for danbooru

This commit is contained in:
grumbulon 2022-05-06 16:38:26 -04:00
parent b4b22d1f8a
commit 3fe8306578
2 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,7 @@
{
"booru": ["danbooru", "safebooru"],
"characterTags": ["onodera_kosaki", "tohsaka_rin", "izumi_konata"],
"tags": ["-underwear"],
"characterTags": ["onodera_kosaki", "tohsaka_rin"],
"miscTags": "-underwear",
"tags": [""],
"rating": "safe"
}

View File

@ -15,13 +15,17 @@ export function getFromBooru() {
if (config.rating === "safe") {
config.tags.push("rating:safe");
}
//Select a random index from the array and append the waifu to the tags
const randWaifu = Math.floor(Math.random() * config.characterTags.length);
config.tags.push(config.characterTags[randWaifu]);
//Select a random index from the array to pick which booru is being queried
const randBooru = Math.floor(Math.random() * config.booru.length);
if (config.booru[randBooru] === "safebooru") {
config.tags.push(config.miscTags);
}
//Select a random index from the array and append the waifu to the tags
const randWaifu = Math.floor(Math.random() * config.characterTags.length);
config.tags.push(config.characterTags[randWaifu]);
console.log(config.tags, config.booru[randBooru]);
search(config.booru[randBooru], config.tags, {
limit: 1,
random: true,