diff --git a/app/index.html b/app/index.html index 35e8771..9d4e239 100644 --- a/app/index.html +++ b/app/index.html @@ -339,6 +339,18 @@

Subtitle Settings

+
+
+ Style Overwrite +
+ + + + + +
@@ -414,7 +426,7 @@
- +
diff --git a/app/js/settingsHandler.js b/app/js/settingsHandler.js index 214a15b..76a9e6c 100644 --- a/app/js/settingsHandler.js +++ b/app/js/settingsHandler.js @@ -1,5 +1,5 @@ const settingsElements = [ - volume, player2, player3, player4, player5, player6, player7, player8, player10, subtitle2, subtitle3, torrent1, torrent2, torrent3, torrent4, torrent5, torrent6, torrent7, torrent8, torrent9, other1, other2 + volume, player2, player3, player4, player5, player6, player7, player8, player10, subtitle1, subtitle2, subtitle3, torrent1, torrent2, torrent3, torrent4, torrent5, torrent6, torrent7, torrent8, torrent9, other1, other2 ] setRes.addEventListener("click", restoreDefaults) settingsTab.addEventListener("click", applySettingsTimeout) diff --git a/app/js/subtitleOctopus.js b/app/js/subtitleOctopus.js index 7d5c6bc..57aa9e0 100644 --- a/app/js/subtitleOctopus.js +++ b/app/js/subtitleOctopus.js @@ -23,7 +23,7 @@ PlayResY: 360 [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Roboto Medium,26,&H00FFFFFF,&H000000FF,&H00020713,&H00000000,0,0,0,0,100,100,0,0,1,1.3,0,2,20,20,23,1 +Style: Default,${Object.values(subtitle1list.options).filter(item => item.value == settings.subtitle1)[0].innerText} [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text @@ -98,6 +98,7 @@ function postDownload(file) { // parse subtitles fully after a download is finis }) parser.on('subtitle', (subtitle, trackNumber) => { if (playerData.headers) { + if (playerData.headers[trackNumber].type == "webvtt") convertSub(subtitle) subtitles[trackNumber].add("Dialogue: " + (subtitle.layer || 0) + "," + new Date(subtitle.time).toISOString().slice(12, -1).slice(0, -1) + "," + new Date(subtitle.time + subtitle.duration).toISOString().slice(12, -1).slice(0, -1) + "," + (subtitle.style || "Default") + "," + (subtitle.name || "") + "," + (subtitle.marginL || "0") + "," + (subtitle.marginR || "0") + "," + (subtitle.marginV || "0") + "," + (subtitle.effect || "") + "," + subtitle.text) } })