fix: check if translation exists before processing in background
This commit is contained in:
@@ -507,6 +507,8 @@ DB.getDB.then((DB) => {
|
|||||||
// To avoid huge translations or mostly-media posts
|
// To avoid huge translations or mostly-media posts
|
||||||
if (post.content.length > 1000) return;
|
if (post.content.length > 1000) return;
|
||||||
|
|
||||||
|
if (post.translations && post.translations[targetLang]) return;
|
||||||
|
|
||||||
const translation = await translateText({
|
const translation = await translateText({
|
||||||
text: post.content,
|
text: post.content,
|
||||||
sourceLang: "auto",
|
sourceLang: "auto",
|
||||||
|
|||||||
Reference in New Issue
Block a user