feat: ノートの翻訳機能

Resolve #5213
This commit is contained in:
syuilo
2021-08-15 20:26:44 +09:00
parent 1cd6ba3c1d
commit cced83024b
11 changed files with 210 additions and 17 deletions

View File

@@ -145,6 +145,10 @@ export const meta = {
validator: $.optional.nullable.str,
},
deeplAuthKey: {
validator: $.optional.nullable.str,
},
enableTwitterIntegration: {
validator: $.optional.bool,
},
@@ -562,6 +566,14 @@ export default define(meta, async (ps, me) => {
set.objectStorageS3ForcePathStyle = ps.objectStorageS3ForcePathStyle;
}
if (ps.deeplAuthKey !== undefined) {
if (ps.deeplAuthKey === '') {
set.deeplAuthKey = null;
} else {
set.deeplAuthKey = ps.deeplAuthKey;
}
}
await getConnection().transaction(async transactionalEntityManager => {
const meta = await transactionalEntityManager.findOne(Meta, {
order: {