home: re-add removed hcollaborator hiding

This commit is contained in:
Alexander Capehart 2024-10-21 09:35:54 -06:00
parent 03be2ef028
commit 64fbd0acbf
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -87,10 +87,7 @@ private class HomeGeneratorImpl(
}
override fun onHideCollaboratorsChanged() {
// Changes in the hide collaborator setting will change the artist contents
// of the library, consider it a library update.
logD("Collaborator setting changed, forwarding update")
onMusicChanges(MusicRepository.Changes(deviceLibrary = true, userLibrary = false))
invalidator.invalidateMusic(MusicType.ARTISTS, UpdateInstructions.Diff)
}
override fun onSongSortChanged() {
@ -151,7 +148,14 @@ private class HomeGeneratorImpl(
?: emptyList()
override fun artists() =
musicRepository.deviceLibrary?.let { listSettings.artistSort.artists(it.artists) }
musicRepository.deviceLibrary?.let { deviceLibrary ->
val sorted = listSettings.artistSort.artists(deviceLibrary.artists)
if (homeSettings.shouldHideCollaborators) {
sorted.filter { it.explicitAlbums.isNotEmpty() }
} else {
sorted
}
}
?: emptyList()
override fun genres() =