From d876a3f7853bc295a96c4e37a5e73958da85d646 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 26 Oct 2021 06:48:24 +0200 Subject: Improved tag blacklist --- src/api/e926/index.ts | 14 ++++++++++++-- src/config.ts | 7 +++---- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/api/e926/index.ts b/src/api/e926/index.ts index 301ad3f..a691648 100644 --- a/src/api/e926/index.ts +++ b/src/api/e926/index.ts @@ -71,8 +71,18 @@ export async function getRandomPost(query: GetPostQuery): Promise { const postIndex = Math.floor(Math.random() * response.posts.length); const post = response.posts[postIndex]; - - if (post.tags.general.some(tag => query.tagsBlacklist.includes(tag))) { + const mergedTags = [ + ...post.tags.artist, + ...post.tags.character, + ...post.tags.copyright, + ...post.tags.general, + ...post.tags.invalid, + ...post.tags.lore, + ...post.tags.meta, + ...post.tags.species, + ]; + + if (query.tagsBlacklist.some(tag => mergedTags.includes(tag))) { await delay(1000); return getRandomPost(query); } diff --git a/src/config.ts b/src/config.ts index 8eef85b..b81fdcb 100644 --- a/src/config.ts +++ b/src/config.ts @@ -32,6 +32,8 @@ const mainQuery: GetPostQuery = { "-animated", "-transformation", "-m*cro", + "-plushification", + "-foot_focus", "-world_war_*", "-adolf_hitler_(artist)", "-blackkaries", @@ -41,10 +43,7 @@ const mainQuery: GetPostQuery = { "score:>=20", "inpool:false", ], - tagsBlacklist: [ - "plushification", - "foot_focus" - ], + tagsBlacklist: [], maxPage: 118, }; -- cgit v1.2.3-70-g09d2