musikr: handle duplicate playlist songs in graph

Accidentally flattened these out during graphing.
This commit is contained in:
Alexander Capehart 2025-01-22 12:57:11 -07:00
parent e3e19fb0ac
commit 97bd259728
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -141,10 +141,7 @@ private class MusicGraphBuilderImpl : MusicGraph.Builder {
playlistVertices.forEach {
val pointer = SongPointer.UID(entry.key)
val index = it.pointerMap[pointer]
if (index != null) {
it.songVertices[index] = vertex
}
it.pointerMap[pointer]?.forEach { index -> it.songVertices[index] = vertex }
}
}
@ -373,7 +370,7 @@ internal class PlaylistVertex(val prePlaylist: PrePlaylist) {
val pointerMap =
prePlaylist.songPointers
.withIndex()
.associateBy { it.value }
.mapValuesTo(mutableMapOf()) { it.value.index }
.groupBy { it.value }
.mapValuesTo(mutableMapOf()) { entry -> entry.value.map { it.index } }
val tag: Any? = null
}