Automatically delete pools that embed bad content

This commit is contained in:
Tarrgon
2026-06-17 09:12:01 -04:00
parent 0aaa4483f3
commit 52300b1227
3 changed files with 94 additions and 4 deletions
+9 -1
View File
@@ -1,5 +1,5 @@
import { config } from '../config';
import { E621Post, E621User, PostFlag, Record } from '../types';
import { E621Pool, E621Post, E621User, PostFlag, Record } from '../types';
const BLACKLISTED_TAGS: string[] = [];
const BLACKLISTED_NONSAFE_TAGS: string[] = ['young'];
@@ -52,6 +52,10 @@ export async function getE621PostFlag(id: number): Promise<PostFlag | null> {
return await request(`/post_flags/${id}`) as PostFlag ?? null;
}
export async function getE621Pool(id: string | number): Promise<E621Pool | null> {
return (await request(`/pools/${id}`)) as E621Pool ?? null;
}
export const enum PostAction {
NoAction = 0,
Spoiler = 1,
@@ -79,6 +83,10 @@ export function getPostUrl(post: E621Post): string {
return `${config.E621_BASE_URL}/posts/${post.id}`;
}
export function getPoolUrl(pool: E621Pool): string {
return `${config.E621_BASE_URL}/pools/${pool.id}`;
}
export async function userIsBanned(idOrName: string | number): Promise<boolean> {
const user = await getE621User(idOrName);
return user?.is_banned ?? false;