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 +++++ src/config.ts | 1 + 2 files changed, 6 insertions(+) (limited to 'src') 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) { diff --git a/src/config.ts b/src/config.ts index 7d20621..a982124 100644 --- a/src/config.ts +++ b/src/config.ts @@ -40,6 +40,7 @@ export default { queries: [ mainQuery, ], + blacklist: [] as number[], }, /*misskey: { instance: "https://mk.vulpes.one/", -- cgit v1.2.3-70-g09d2