musikr: fix graphing error w/certain link steps
I wasn't correctly linking genres, which would cascade to a dead vertex down the line. Will need better diagnostics here.
This commit is contained in:
parent
0e34a28dfb
commit
3d690eb637
1 changed files with 5 additions and 1 deletions
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
package org.oxycblt.musikr.graph
|
package org.oxycblt.musikr.graph
|
||||||
|
|
||||||
|
import android.util.Log
|
||||||
import org.oxycblt.musikr.Music
|
import org.oxycblt.musikr.Music
|
||||||
import org.oxycblt.musikr.playlist.SongPointer
|
import org.oxycblt.musikr.playlist.SongPointer
|
||||||
import org.oxycblt.musikr.playlist.interpret.PrePlaylist
|
import org.oxycblt.musikr.playlist.interpret.PrePlaylist
|
||||||
|
@ -148,12 +149,14 @@ private class MusicGraphBuilderImpl : MusicGraph.Builder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return MusicGraph(
|
val graph = MusicGraph(
|
||||||
songVertices.values.toList(),
|
songVertices.values.toList(),
|
||||||
albumVertices.values.toList(),
|
albumVertices.values.toList(),
|
||||||
artistVertices.values.toList(),
|
artistVertices.values.toList(),
|
||||||
genreVertices.values.toList(),
|
genreVertices.values.toList(),
|
||||||
playlistVertices)
|
playlistVertices)
|
||||||
|
|
||||||
|
return graph
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun simplifyGenreCluster(cluster: Collection<GenreVertex>) {
|
private fun simplifyGenreCluster(cluster: Collection<GenreVertex>) {
|
||||||
|
@ -240,6 +243,7 @@ private class MusicGraphBuilderImpl : MusicGraph.Builder {
|
||||||
// Link all songs and albums from the irrelevant artist to the relevant artist.
|
// Link all songs and albums from the irrelevant artist to the relevant artist.
|
||||||
dst.songVertices.addAll(src.songVertices)
|
dst.songVertices.addAll(src.songVertices)
|
||||||
dst.albumVertices.addAll(src.albumVertices)
|
dst.albumVertices.addAll(src.albumVertices)
|
||||||
|
dst.genreVertices.addAll(src.genreVertices)
|
||||||
// Update all songs, albums, and genres to point to the relevant artist.
|
// Update all songs, albums, and genres to point to the relevant artist.
|
||||||
src.songVertices.forEach {
|
src.songVertices.forEach {
|
||||||
val index = it.artistVertices.indexOf(src)
|
val index = it.artistVertices.indexOf(src)
|
||||||
|
|
Loading…
Reference in a new issue