arcusmaximus / YTSubConverter

A tool for creating styled YouTube subtitles
MIT License
777 stars 55 forks source link

Autoconvert not working when saved from Aegisub #14

Closed AlphaPizza closed 4 years ago

AlphaPizza commented 4 years ago

Version tested: 1.4.1 OS: Windows 10 Home 1909

Description The autoconvert feature seems to not trigger properly when a file is being saved directly from Aegisub (tested with the official 3.2.2-portable-64bit and the unofficial 3.3.0-win64). Neither the "Save Subtitles", "Save Subtitles as" or the "Export Subtitles..." action of Aegisub triggered the autoconvert.

That being said, the feature does work if the file is modified from another editor, like notepad or notepad++, or even an IDE like IntelliJ.

Maybe related? From: https://stackoverflow.com/questions/680698/why-doesnt-filesystemwatcher-detect-changes-from-visual-studio/681078 According to https://github.com/Aegisub/Aegisub/blob/master/libaegisub/common/io.cpp Aegisub is not writing directly to the target file when saving. It is writing to a temp file, and when the writing is done it renames the temp file to the target file. This is maybe the issue, as regardless of the editor used, for a target file named subs.ass, if we saved new changes to temp_file.ass, delete the existing subs.ass, and rename temp_file.ass to subs.ass, YTSubConverter does not detect any change.

arcusmaximus commented 4 years ago

The feature worked when saving from Aegisub on Windows 7, but it looks like Windows 10 behaves differently. Fixed now.