TypesettingTools / Myaamori-Aegisub-Scripts

Overengineering is my middle name.
MIT License
37 stars 7 forks source link

Merge function should merge/delete identical styles #23

Open Ninelpienel opened 1 year ago

Ninelpienel commented 1 year ago

Hey, I merged two files with the same styles and noted that subdigest just put all styles of my second script under the styles of my fist one, although they are the same. Would be cool if subdigest could recognize such cases.

image

FichteFoll commented 1 year ago

Could you please share the command/code that was used to invoke subdigest?

Ninelpienel commented 1 year ago

subdigest.exe -i "%name%-%tag%_!episode!_prass.ass" --merge-file "%name%-%tag%-forced_!episode!_type.ass" -o "%name%-%tag%_!episode!_merged.ass"

FichteFoll commented 1 year ago

Ideally also the two files that were used to create this one (just the styles and one line of dialogue would suffice) because subdigest in general already does deduplicate styles from multiple files but only if they are identical. If they are not identical, it can be debated what exactly subdigest should do instead (error and abort, ignore the second style, overwrite the first style) and I would err on the save side with erroring, but maybe @Myaamori can share what he had in mind here initially.

https://github.com/TypesettingTools/Myaamori-Aegisub-Scripts/blob/f2a52ee38eeb60934175722fa9d7f2c2aae015c6/scripts/sub-digest/subdigest.py#L271-L282

Edit: I see a problem in this snippet that should occur when they are indeed identical. Will take a look at properly fixing it when I'm back from vacation, probably.

Ninelpienel commented 1 year ago

Here are the files.

ass.zip

FichteFoll commented 1 year ago

I've confirmed that the styles (and the rest of the metadata in theses files) are indeed exactly identical and sub-digest should not include both. I implemented the fix for it in #24.

However, I'm afraid that @Myaamori seems to have been AWOL for over a year now with no activity on GitHub or on any of the Discord servers that we share. I may or may not ask someone from the admins of this org if they could provide me with access to this repository to at least provide some level of maintenance for the tools I care about/have knowledge of, i.e. the Python scripts (and the merge scripts Automation). Though, I also believe that both of these tools should rather be in separate repositories and not included inside this one initially meant for Automation scripts. Especially the size of the readme should be an indicator of that.