Fix(solfa): support multiple override lyrics tag

This commit is contained in:
Hasinjato 2026-11-17 16:57:45 +03:00
parent 382373d6be
commit d6c7b70792

View file

@ -2757,9 +2757,9 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
positionDS.add(i)
}
val originalLyrics = REGEX_STRIP_DC.replace(lyricsItem, "")
val REGEX_OVERRIDE = Regex(".*\\$\\{O:(\\d+)\\}.*")
if (REGEX_OVERRIDE.matches(lyricsItem)) {
val overrideNumber = lyricsItem.replace(REGEX_OVERRIDE, "$1").toInt()
val REGEX_OVERRIDE = Regex("\\$\\{O:(\\d+)\\}")
REGEX_OVERRIDE.findAll(lyricsItem).forEach { matchResult ->
val overrideNumber = matchResult.groupValues[1].toInt()
val override = O.getOrElse(overrideNumber) { null }
override?.forEachIndexed { index, value ->
val matchResult = Regex("v(\\d+):(.*)").find(value)