Fixes/enchancements for vtt2ass with new Hidive Q styles #626

Merged
IONI0 merged 2 commits from vtt2ass-changes-branch into master 2024-04-04 00:59:19 +00:00
IONI0 commented 2024-04-02 06:03:13 +00:00 (Migrated from github.com)

Addresses https://github.com/anidl/multi-downloader-nx/issues/608.

  • That is, properly reverse simultaneous lines. As a side effect, all lines with a \pos tag will be put at the bottom of the script which lines up better with the behavior before the new Q styles. The implementation in V4.6.0 has some issues with lines being ordered weirdly and newlines being assigned to the wrong events.

Additional enhancements:

  • Lines with the same data that are adjacent become joined into one event
Dialogue: 0,0:06:10.92,0:06:11.71,Q0,,0,0,0,,I'm telling you though, there really is-
Dialogue: 0,0:06:11.71,0:06:13.08,Q0,,0,0,0,,I'm telling you though, there really is-
Dialogue: 0,0:06:11.71,0:06:13.08,Q2,,0,0,0,,I told her we'd talk, but...
Dialogue: 0,0:06:13.08,0:06:14.42,Q2,,0,0,0,,I told her we'd talk, but...

Becomes

Dialogue: 0,0:06:10.92,0:06:13.08,Q0,,0,0,0,,I'm telling you though, there really is-
Dialogue: 0,0:06:11.71,0:06:14.42,Q2,,0,0,0,,I told her we'd talk, but...

This does mean that it will look different from what it looks like on Hidive but it should be more readable. For example in an event like what was shown above:

Line 1 -> nothing
Line 2 -> line 1
Line 3 -> line 2

Becomes

Line 1 -> Line 1
Line 2 -> Line 2
Line 3 -> Empty space

This is done in line 367 if you want to link it up to an option or turn it off.


  • Lines without a \pos tag get layer 1 so that they can display over potential captions if needed. Otherwise the previous behavior was that captions would obscure the dialogue.

This is done in line 273, you can change it to Dialogue: 0,${line.start},${line.end},${line.style},,0,0,0,,${line.text});` to make it remain on layer 0.

Addresses https://github.com/anidl/multi-downloader-nx/issues/608. - That is, properly reverse simultaneous lines. As a side effect, all lines with a \pos tag will be put at the bottom of the script which lines up better with the behavior before the new Q styles. The implementation in V4.6.0 has some issues with lines being ordered weirdly and newlines being assigned to the wrong events. --- Additional enhancements: - Lines with the same data that are adjacent become joined into one event ``` Dialogue: 0,0:06:10.92,0:06:11.71,Q0,,0,0,0,,I'm telling you though, there really is- Dialogue: 0,0:06:11.71,0:06:13.08,Q0,,0,0,0,,I'm telling you though, there really is- Dialogue: 0,0:06:11.71,0:06:13.08,Q2,,0,0,0,,I told her we'd talk, but... Dialogue: 0,0:06:13.08,0:06:14.42,Q2,,0,0,0,,I told her we'd talk, but... ``` Becomes ``` Dialogue: 0,0:06:10.92,0:06:13.08,Q0,,0,0,0,,I'm telling you though, there really is- Dialogue: 0,0:06:11.71,0:06:14.42,Q2,,0,0,0,,I told her we'd talk, but... ``` This does mean that it will look different from what it looks like on Hidive but it should be more readable. For example in an event like what was shown above: ``` Line 1 -> nothing Line 2 -> line 1 Line 3 -> line 2 ``` Becomes ``` Line 1 -> Line 1 Line 2 -> Line 2 Line 3 -> Empty space ``` This is done in `line 367` if you want to link it up to an option or turn it off. --- - Lines without a \pos tag get layer 1 so that they can display over potential captions if needed. Otherwise the previous behavior was that captions would obscure the dialogue. This is done in `line 273`, you can change it to ` Dialogue: 0,${line.start},${line.end},${line.style},,0,0,0,,${line.text}`);` to make it remain on layer 0.
AnimeDL commented 2024-04-03 20:41:37 +00:00 (Migrated from github.com)

Could you please fix the eslint errors? I highly recommend setting up your dev environment for eslint if you haven't already

Could you please fix the eslint errors? I highly recommend setting up your dev environment for eslint if you haven't already
IONI0 commented 2024-04-03 22:46:31 +00:00 (Migrated from github.com)

I've fixed the Eslint errors a logic error with aligning start time of subs, and added a cli option for combineLines which is false by default. Let me know if anything else is wrong

I've fixed the Eslint errors a logic error with aligning start time of subs, and added a cli option for combineLines which is false by default. Let me know if anything else is wrong
AnimeDL commented 2024-04-04 00:59:13 +00:00 (Migrated from github.com)

LGTM, merging

LGTM, merging
Sign in to join this conversation.
No description provided.