From c9f60831a7a678f3a8db3fa832e31eda19fa6dab Mon Sep 17 00:00:00 2001 From: Virgil Clyne Date: Tue, 5 Nov 2024 14:31:43 +0800 Subject: [PATCH] fix(timedtext): delete para.s Update Translate.response.dev.js Update Translate.response.js Update Composite.mjs Update CHANGELOG.md Update package.json Update package-lock.json --- CHANGELOG.md | 3 +++ package-lock.json | 20 ++++++++++---------- package.json | 4 ++-- src/Translate.response.dev.js | 3 ++- src/Translate.response.js | 3 ++- src/class/Composite.mjs | 2 ++ 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6ef2bc7..db3fc387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 🛠️ Bug Fixes + * 修复 `YouTube` 的 `timedText` 格式`自动生成 (asr)字幕`的`翻译字幕`生成错误 + ### 🔣 Dependencies * 分离`翻译器`脚本中的 `YouTube` 和 `Spotify` 的 `protobuf` * 分离`外部歌词`脚本中的 `YouTube` 和 `Spotify` 的 `protobuf` diff --git a/package-lock.json b/package-lock.json index 4b93e31b..f5169185 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@dualsubs/universal", - "version": "1.6.0", + "version": "1.6.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dualsubs/universal", - "version": "1.6.0", + "version": "1.6.2", "license": "Apache-2.0", "devDependencies": { - "@iringo/arguments-builder": "^1.8.1", + "@iringo/arguments-builder": "^1.8.2", "@nsnanocat/util": "^1.3.2", "@protobuf-ts/plugin": "^2.9.4", "@protobuf-ts/runtime": "^2.9.4", @@ -56,12 +56,12 @@ } }, "node_modules/@iringo/arguments-builder": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@iringo/arguments-builder/-/arguments-builder-1.8.1.tgz", - "integrity": "sha512-QEISc/nO4kFm8SgH66o0JzWGX9qWtVoWWjiOOh1PGwzdoMLIL7h37gL9z27aULknhUQHn1UDovdDGNu2fYgWEw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@iringo/arguments-builder/-/arguments-builder-1.8.2.tgz", + "integrity": "sha512-xpnu+NOeuf9RBcvVfefe04Wu9SDI1RVTovoqLvgFniBIz/0IcpmTcLvepLXPiu5myVdmpiEFo2gwlaLSDieV4g==", "dev": true, "dependencies": { - "@iringo/surge2egern": "^1.0.1", + "@iringo/surge2egern": "^1.1.0", "@iringo/utils": "^1.0.1", "commander": "^12.1.0", "date-fns": "^4.1.0", @@ -75,9 +75,9 @@ } }, "node_modules/@iringo/surge2egern": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@iringo/surge2egern/-/surge2egern-1.0.1.tgz", - "integrity": "sha512-ekNft/xm4SW4zZ8+AijYUoanxKUcM70lLk3mbDgI9yFJL7zhsagRjCHhbciEzX2aOEW7v7tywA/opWeS7u9Wbw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@iringo/surge2egern/-/surge2egern-1.1.0.tgz", + "integrity": "sha512-8DEu6sIeWCTC0B6TOzXaGyI4IBnhuKKXE0sgNjyA/dfcwoT4jQDoDlaTQUHh2MVqB8OfD2R4gStaogw+o9qqng==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 7af54532..e7427138 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dualsubs/universal", - "version": "1.6.0", + "version": "1.6.2", "organizationName": "🍿️ DualSubs", "displayName": "🍿️ DualSubs: 🔣 Universal", "description": "流媒体平台字幕增强及双语模块\n如需恢复TV完整支持\n请配合“ iRingo: 📺 TV”使用", @@ -38,7 +38,7 @@ "iOS >= 15" ], "devDependencies": { - "@iringo/arguments-builder": "^1.8.1", + "@iringo/arguments-builder": "^1.8.2", "@nsnanocat/util": "^1.3.2", "@protobuf-ts/plugin": "^2.9.4", "@protobuf-ts/runtime": "^2.9.4", diff --git a/src/Translate.response.dev.js b/src/Translate.response.dev.js index 903d7049..d8bcf515 100644 --- a/src/Translate.response.dev.js +++ b/src/Translate.response.dev.js @@ -68,7 +68,8 @@ log(`⚠ FORMAT: ${FORMAT}`, ""); if (para?.s) { if (Array.isArray(para.s)) para["#"] = para.s.map(seg => seg["#"]).join(" "); else para["#"] = para.s?.["#"] ?? ""; - para.s = undefined; + // biome-ignore lint/performance/noDelete: + delete para.s; } const span = para?.span ?? para; const sentences = Array.isArray(span) ? span?.map(span => span?.["#"] ?? "\u200b").join(breakLine) : span?.["#"]; diff --git a/src/Translate.response.js b/src/Translate.response.js index 27a767e8..45bc2f33 100644 --- a/src/Translate.response.js +++ b/src/Translate.response.js @@ -63,7 +63,8 @@ log(`⚠ FORMAT: ${FORMAT}`, ""); if (para?.s) { if (Array.isArray(para.s)) para["#"] = para.s.map(seg => seg["#"]).join(" "); else para["#"] = para.s?.["#"] ?? ""; - para.s = undefined; + // biome-ignore lint/performance/noDelete: + delete para.s; } const span = para?.span ?? para; const sentences = Array.isArray(span) ? span?.map(span => span?.["#"] ?? "\u200b").join(breakLine) : span?.["#"]; diff --git a/src/class/Composite.mjs b/src/class/Composite.mjs index 4f734a2f..93a436f3 100644 --- a/src/class/Composite.mjs +++ b/src/class/Composite.mjs @@ -104,6 +104,7 @@ export default class Composite { if (para?.s) { if (Array.isArray(para?.s)) para["#"] = para?.s.map(seg => seg["#"]).join(""); else para["#"] = para.s?.["#"] ?? ""; + // biome-ignore lint/performance/noDelete: delete para.s; }; return para; @@ -112,6 +113,7 @@ export default class Composite { if (para?.s) { if (Array.isArray(para?.s)) para["#"] = para?.s.map(seg => seg["#"]).join(""); else para["#"] = para.s?.["#"] ?? ""; + // biome-ignore lint/performance/noDelete: delete para.s; }; return para;