This commit is contained in:
ThatOneCalculator 2023-09-19 17:14:01 -07:00
parent 5964a10571
commit 414f6df104
No known key found for this signature in database
GPG key ID: 8703CACD01000000

View file

@ -204,14 +204,7 @@ export const NoteRepository = db.getRepository(Note).extend({
host,
);
let lang;
try {
lang = (detectLanguage_((note.text || "") + (note.cw || "")))
.languages[0].code;
} catch (e) {
lang =
detect((note.text || "") + (note.cw || ""))?.[0]?.lang || "unknown";
}
const lang = detectLanguage_(`${note.cw ?? ''}\n${note.text ?? ''}`) ?? "unknown"
const reactionEmoji = await populateEmojis(reactionEmojiNames, host);
const packed: Packed<"Note"> = await awaitAll({
id: note.id,