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() { override fun onHideCollaboratorsChanged() {
// Changes in the hide collaborator setting will change the artist contents invalidator.invalidateMusic(MusicType.ARTISTS, UpdateInstructions.Diff)
// of the library, consider it a library update.
logD("Collaborator setting changed, forwarding update")
onMusicChanges(MusicRepository.Changes(deviceLibrary = true, userLibrary = false))
} }
override fun onSongSortChanged() { override fun onSongSortChanged() {
@ -151,7 +148,14 @@ private class HomeGeneratorImpl(
?: emptyList() ?: emptyList()
override fun artists() = 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() ?: emptyList()
override fun genres() = override fun genres() =