enable reab, fix realb,

This commit is contained in:
creations 2025-02-02 13:52:02 -05:00
parent 892c67f5c5
commit b8947e610d
Signed by: creations
GPG key ID: 8F553AA4320FC711
2 changed files with 11 additions and 7 deletions

View file

@ -18,9 +18,9 @@ export const booruConfig: IBooruConfigMap = {
autocomplete: "ac.rule34.xxx/autocomplete.php?q=",
},
"realbooru.com": {
enabled: false,
enabled: true,
name: "realbooru.com",
aliases: ["realbooru", "rb", "real34"],
aliases: ["realbooru", "rb", "real34", "realb"],
endpoint: "realbooru.com",
functions: booruDefaults,
autocomplete: "realbooru.com/index.php?page=autocomplete&term=",

View file

@ -281,12 +281,16 @@ async function handler(
const parsedData: Data = data as Data;
let posts: BooruPost[] = [];
if (parsedData.post) {
posts = [parsedData.post];
} else if (parsedData.posts) {
posts = parsedData.posts;
if (booruConfig.name === "realbooru.com") {
posts = parsedData.post || [];
} else {
posts = Array.isArray(data) ? (data as BooruPost[]) : [];
if (parsedData.post) {
posts = [parsedData.post];
} else if (parsedData.posts) {
posts = parsedData.posts;
} else {
posts = Array.isArray(data) ? (data as BooruPost[]) : [];
}
}
if (posts.length === 0) continue;