From c098014a4e07b98f17425fa81ea0e0819e14e37a Mon Sep 17 00:00:00 2001 From: bob1520 <80553357+hockerschwan@users.noreply.github.com> Date: Fri, 27 May 2022 11:46:49 +0900 Subject: [PATCH] Fix caption baseurl (#2268) * fix caption * remove duplicate auto-translation from english --- src/renderer/views/Watch/Watch.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 5fe9201b..d62ce05c 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -422,8 +422,9 @@ export default Vue.extend({ ) if (!standardLocale.startsWith('en') && noLocaleCaption) { - const baseUrl = result.player_response.captions.playerCaptionsRenderer.baseUrl - this.tryAddingTranslatedLocaleCaption(captionTracks, standardLocale, baseUrl) + captionTracks.forEach((caption) => { + this.tryAddingTranslatedLocaleCaption(captionTracks, standardLocale, caption.baseUrl) + }) } } @@ -1156,6 +1157,13 @@ export default Vue.extend({ label = `${this.$t('Locale Name')} (translated from English)` } + const indexTranslated = captionTracks.findIndex((item) => { + return item.name.simpleText === label + }) + if (indexTranslated !== -1) { + return + } + if (enCaptionExists) { url = new URL(captionTracks[enCaptionIdx].baseUrl) } else {