diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/api/e926/index.ts | 5 | ||||
| -rw-r--r-- | src/config.ts | 1 |
2 files changed, 6 insertions, 0 deletions
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<Post> { | |||
| 71 | const postIndex = Math.floor(Math.random() * response.posts.length); | 71 | const postIndex = Math.floor(Math.random() * response.posts.length); |
| 72 | const post = response.posts[postIndex]; | 72 | const post = response.posts[postIndex]; |
| 73 | 73 | ||
| 74 | if (config.e621.blacklist.includes(post.id)) { | ||
| 75 | await delay(1000); | ||
| 76 | return getRandomPost(query); | ||
| 77 | } | ||
| 78 | |||
| 74 | const isDupe = await dedupeDb.insertIfNotExists({ provider: "e926", id: post.id }); | 79 | const isDupe = await dedupeDb.insertIfNotExists({ provider: "e926", id: post.id }); |
| 75 | 80 | ||
| 76 | if (isDupe) { | 81 | 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 { | |||
| 40 | queries: [ | 40 | queries: [ |
| 41 | mainQuery, | 41 | mainQuery, |
| 42 | ], | 42 | ], |
| 43 | blacklist: [] as number[], | ||
| 43 | }, | 44 | }, |
| 44 | /*misskey: { | 45 | /*misskey: { |
| 45 | instance: "https://mk.vulpes.one/", | 46 | instance: "https://mk.vulpes.one/", |
