diff options
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/e926/index.ts | 12 |
1 files changed, 11 insertions, 1 deletions
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<Post> { | |||
| 71 | 71 | ||
| 72 | const postIndex = Math.floor(Math.random() * response.posts.length); | 72 | const postIndex = Math.floor(Math.random() * response.posts.length); |
| 73 | const post = response.posts[postIndex]; | 73 | const post = response.posts[postIndex]; |
| 74 | const mergedTags = [ | ||
| 75 | ...post.tags.artist, | ||
| 76 | ...post.tags.character, | ||
| 77 | ...post.tags.copyright, | ||
| 78 | ...post.tags.general, | ||
| 79 | ...post.tags.invalid, | ||
| 80 | ...post.tags.lore, | ||
| 81 | ...post.tags.meta, | ||
| 82 | ...post.tags.species, | ||
| 83 | ]; | ||
| 74 | 84 | ||
| 75 | if (post.tags.general.some(tag => query.tagsBlacklist.includes(tag))) { | 85 | if (query.tagsBlacklist.some(tag => mergedTags.includes(tag))) { |
| 76 | await delay(1000); | 86 | await delay(1000); |
| 77 | return getRandomPost(query); | 87 | return getRandomPost(query); |
| 78 | } | 88 | } |
