diff --git a/enjoy/src/i18n/en.json b/enjoy/src/i18n/en.json index 17441c2b..37d71e4c 100644 --- a/enjoy/src/i18n/en.json +++ b/enjoy/src/i18n/en.json @@ -21,6 +21,7 @@ "added": "Successfully added audio", "removed": "Successfully removed audio", "notFound": "Video not found", + "fileTooLarge": "File too large {{ file }}", "failedToAdd": "Failed to add audio, {{ error }}", "fileNotFound": "File not found {{file}}", "fileNotSupported": "File not supported {{file}}", @@ -45,6 +46,7 @@ "added": "Successfully added video", "removed": "Successfully removed video", "notFound": "Video not found", + "fileTooLarge": "File too large {{ file }}", "failedToAdd": "Failed to add video, {{ error }}", "fileNotFound": "File not found {{file}}", "fileNotSupported": "File not supported {{file}}", @@ -82,6 +84,7 @@ "ttsEngine": "TTS engine", "ttsModel": "TTS model", "ttsVoice": "TTS voice", + "ttsBaseUrl": "TTS base URL", "notFound": "Conversation not found", "contentRequired": "Content required" }, diff --git a/enjoy/src/i18n/zh-CN.json b/enjoy/src/i18n/zh-CN.json index ada25107..87480325 100644 --- a/enjoy/src/i18n/zh-CN.json +++ b/enjoy/src/i18n/zh-CN.json @@ -21,6 +21,7 @@ "added": "成功添加音频", "removed": "成功删除音频", "notFound": "未找到音频", + "fileTooLarge": "文件太大了 {{ file }}", "failedToAdd": "添加音频失败, {{error}}", "fileNotFound": "无法访问文件 {{file}}", "fileNotSupported": "文件不支持 {{file}}", @@ -45,6 +46,7 @@ "added": "成功添加视频", "removed": "成功删除视频", "notFound": "未找到视频", + "fileTooLarge": "文件太大了 {{ file }}", "failedToAdd": "添加视频失败, {{error}}", "fileNotFound": "无法访问文件 {{file}}", "fileNotSupported": "文件不支持 {{file}}", @@ -82,6 +84,7 @@ "ttsEngine": "TTS 引擎", "ttsModel": "TTS 模型", "ttsVoice": "TTS 声音", + "ttsBaseUrl": "TTS 请求地址", "notFound": "未找到对话", "contentRequired": "对话内容不能为空" }, diff --git a/enjoy/src/main/db/models/audio.ts b/enjoy/src/main/db/models/audio.ts index 95ebc4b1..07973f0d 100644 --- a/enjoy/src/main/db/models/audio.ts +++ b/enjoy/src/main/db/models/audio.ts @@ -29,6 +29,8 @@ import webApi from "@main/web-api"; import { startCase } from "lodash"; import { v5 as uuidv5 } from "uuid"; +const SIZE_LIMIT = 1024 * 1024 * 50; // 50MB + const logger = log.scope("db/models/audio"); @Table({ modelName: "Audio", @@ -240,6 +242,11 @@ export class Audio extends Model