Fix for ASSA new file default style - thx mpr0st :)

Fix #7839
(when default style if not "Default")
This commit is contained in:
Nikolaj Olsson 2024-01-14 17:32:26 +01:00
parent fbc1447428
commit 730ff76951

View File

@ -178,7 +178,9 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text"
else
{
sb.AppendFormat(header, title).AppendLine();
styles = GetStylesFromHeader(header);
}
foreach (var p in subtitle.Paragraphs)
{
var start = MakeTimeCode(timeCodeFormat, p.StartTime);
@ -188,6 +190,10 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text"
{
style = p.Extra;
}
else if (styles.Count > 0 && !styles.Contains(style) && styles.Contains(p.Extra))
{
style = p.Extra;
}
if (fromTtml && !string.IsNullOrEmpty(p.Style) && isValidAssHeader && styles.Contains(p.Style))
{
@ -241,6 +247,7 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text"
sb.AppendLine();
sb.AppendLine(subtitle.Footer);
}
return sb.ToString().Trim() + Environment.NewLine;
}