This commit is contained in:
Ashley Graves 2024-10-12 00:51:54 +02:00
parent a9cf2be98b
commit 45590a74cb

View file

@ -124,14 +124,13 @@ module.exports = {
const tags = (interaction.options.getString("tags") ?? "").split(" "); const tags = (interaction.options.getString("tags") ?? "").split(" ");
const booru = interaction.options.getString("booru") ?? defaultBooru; const booru = interaction.options.getString("booru") ?? defaultBooru;
const rating = (interaction.options.getString("rating") ?? ratings[0]);
var result = await knex.select("blacklist").from("blacklists").where("user", interaction.user.id).first(); var result = await knex.select("blacklist").from("blacklists").where("user", interaction.user.id).first();
if (!result) if (!result)
result = { blacklist: '' }; result = { blacklist: '' };
const userBlacklist = (result.blacklist ?? "").trim().split(" ").filter(notEmpty); const userBlacklist = (result.blacklist ?? "").trim().split(" ").filter(notEmpty);
const searchTags = [rating, ...tags, ...[...blacklist, ...userBlacklist].map(i => "-" + i)]; const searchTags = [...tags, ...[...blacklist, ...userBlacklist].map(i => "-" + i)];
const startTime = process.hrtime.bigint(); const startTime = process.hrtime.bigint();
var tries = 0; var tries = 0;
@ -148,6 +147,9 @@ module.exports = {
const endTime = process.hrtime.bigint(); const endTime = process.hrtime.bigint();
const timeTaken = endTime - startTime; const timeTaken = endTime - startTime;
if (post.booru.domain == "gelbooru.com" && post.rating == "s")
post.rating = "q";
const fileName = (post.rating != "g" ? "SPOILER_" : "") + basename(post.fileUrl); const fileName = (post.rating != "g" ? "SPOILER_" : "") + basename(post.fileUrl);
const ext = extname(fileName).toLowerCase(); const ext = extname(fileName).toLowerCase();