TypesettingTools / Aegisub

Cross-platform advanced subtitle editor
http://www.aegisub.org
Other
330 stars 494 forks source link

Does Automation/Select overlaps work for you? #197

Open slrslr opened 7 months ago

slrslr commented 7 months ago

Open .srt file, menu "Automation" > Select overlaps cause Lua reported a runtime error on Linux, Aegisub 3.2.2 Detail Is anyone capable to fix it, i am willing to pay for that fix. Thank you

The file: https://github.com/TypesettingTools/Aegisub/blob/master/automation/autoload/select-overlaps.moon (in /usr/share/aegisub/automation/autoload/select-overlaps.moon)

ChatGPT suggested this modification:

Replace: [prepare i, line for i, line in ipairs subs when is_dialogue line]

by: [prepare i, line for i, line in ipairs(subs) when is_dialogue(line)]

or by: [prepare(i, line) for i, line in ipairs(subs) when is_dialogue(line)]

saying:

"The issue in the provided Lua script is with the ipairs function being used on the subs object. The error message indicates that Lua is expecting a table but received a userdata instead."

But it does not work. Do you have please idea what to try? I am trying to detect and fix subtitle overlaps in several .ass files.

An issue of the luajit and the current Aegisub version?

arch1t3cht commented 7 months ago

This is an issue with Debian's Aegisub package. Aegisub needs luajit to be compiled with the Lua 5.2 compat flag, which Debian's luajit does not seem to have. This results in the __ipairs metatable entry on the subs object not being respected.

To fix this you would need to compile Aegisub yourself with --force-fallback-for=luajit.