add: libretranslate

This commit is contained in:
Marie 2025-03-06 01:03:02 +01:00
parent c5440c20c6
commit 40599190f7
No known key found for this signature in database
GPG key ID: 7ADF6C9CD9A28555
8 changed files with 190 additions and 59 deletions

View file

@ -107,6 +107,8 @@ export const paramDef = {
deeplIsPro: { type: 'boolean' },
deeplFreeMode: { type: 'boolean' },
deeplFreeInstance: { type: 'string', nullable: true },
libreTranslateURL: { type: 'string', nullable: true },
libreTranslateKey: { type: 'string', nullable: true },
enableEmail: { type: 'boolean' },
email: { type: 'string', nullable: true },
smtpSecure: { type: 'boolean' },
@ -577,6 +579,22 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
}
if (ps.libreTranslateURL !== undefined) {
if (ps.libreTranslateURL === '') {
set.libreTranslateURL = null;
} else {
set.libreTranslateURL = ps.libreTranslateURL;
}
}
if (ps.libreTranslateKey !== undefined) {
if (ps.libreTranslateKey === '') {
set.libreTranslateKey = null;
} else {
set.libreTranslateKey = ps.libreTranslateKey;
}
}
if (ps.enableIpLogging !== undefined) {
set.enableIpLogging = ps.enableIpLogging;
}