Fix crash when lines are out of order by sorting (#872)

This commit is contained in:
Luca LeBlanc
2025-08-02 15:16:20 +03:00
committed by GitHub
parent 7765824db0
commit 3b281334c4
@@ -29,7 +29,10 @@ struct LyricsDto {
]
}
else {
lyricsData.lines = lines.map { line in
let sortedLines = lines.sorted {
($0.offsetMs ?? 0) < ($1.offsetMs ?? 0)
}
lyricsData.lines = sortedLines.map { line in
LyricsLine.with {
$0.content = (shouldRomanize && romanization == .canBeRomanized)
? line.content.applyingTransform(.toLatin, reverse: false)!