pysubs2 icon indicating copy to clipboard operation
pysubs2 copied to clipboard

Unable to parse SSAFile from string with empty layer

Open anderson-oki opened this issue 9 months ago • 0 comments

Description

When trying to parse an SSAFile from string using pysubs2.SSAFile.from_string(text) where the content of the Events of Layer is an empty string that represents a single layer, mostly likely 0, we can't parse to int.

substation.py line 203.

elif f in {"borderstyle", "encoding", "marginl", "marginr", "marginv", "layer", "alphalevel"}:
    return int(v)
[Events]
Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
Dialogue: ,0:00:22.98,0:00:24.85,Default,,0,0,0,,DELICIOUS IN DUNGEON
Dialogue: ,0:01:41.30,0:01:42.76,Default,,0,0,0,,Really, though.
Dialogue: ,0:01:43.35,0:01:46.56,Default,,0,0,0,,There's nothing more horrifying\Nthan black magic.
Dialogue: ,0:01:47.23,0:01:50.11,Default,,0,0,0,,Was bringing this person back\Nworth going down that path?

anderson-oki avatar Apr 27 '24 12:04 anderson-oki