From 34d6aa385807bce63c88ca0176190317aea343ba Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 20 Oct 2021 09:28:31 +0200 Subject: Added post id blacklist --- src/api/e926/index.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/api/e926/index.ts') diff --git a/src/api/e926/index.ts b/src/api/e926/index.ts index 37d8598..8e363c9 100644 --- a/src/api/e926/index.ts +++ b/src/api/e926/index.ts @@ -71,6 +71,11 @@ export async function getRandomPost(query: GetPostQuery): Promise { const postIndex = Math.floor(Math.random() * response.posts.length); const post = response.posts[postIndex]; + if (config.e621.blacklist.includes(post.id)) { + await delay(1000); + return getRandomPost(query); + } + const isDupe = await dedupeDb.insertIfNotExists({ provider: "e926", id: post.id }); if (isDupe) { -- cgit v1.2.3-70-g09d2