musikr.tag: handle slash positions in xiph

Resolves #965.
This commit is contained in:
Alexander Capehart 2025-01-18 20:30:51 -07:00
parent a0e10ef8dd
commit 0785711cd6
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 5 additions and 1 deletions

View file

@ -23,6 +23,7 @@
- M3U playlist file name is now proposed if one cannot be found within the file
- Duration is now parsed from certain files that previously could not be parsed
- ID3v2 tags are now parsed from WAV files
- NN/TT tracks/discs are now handled in Vorbis
- Music library will is less likely to fail to respond to updates
- Hidden audio files can now be loaded
- Sorting songs by date now uses songs date first, before the earliest album date

View file

@ -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.