musikr.tag: handle slash positions in xiph

Resolves #965.
This commit is contained in:
Alexander Capehart
2025-01-18 20:32:28 -07:00
parent a0e10ef8dd
commit 0785711cd6
2 changed files with 5 additions and 1 deletions
@@ -48,7 +48,10 @@ internal fun String.parseSlashPositionField() =
* @see transformPositionField
*/
internal fun parseXiphPositionField(pos: String?, total: String?) =
transformPositionField(pos?.toIntOrNull(), total?.toIntOrNull())
pos?.let { posStr ->
posStr.toIntOrNull()?.let { transformPositionField(it, total?.toIntOrNull()) }
?: posStr.parseSlashPositionField()
}
/**
* Transform a raw position + total field into a position a way that tolerates placeholder values.