detail: add playing indicator to genre artists

Add playing indicators to artists within the genre detail view.
This commit is contained in:
Alexander Capehart 2022-11-14 20:33:00 -07:00
parent aa50c82635
commit d764cc7c4e
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 11 additions and 7 deletions

View file

@ -98,7 +98,6 @@ class DetailViewModel(application: Application) :
var artistSort: Sort
get() = settings.detailArtistSort
set(value) {
logD(value)
settings.detailArtistSort = value
currentArtist.value?.let(::refreshArtistData)
}
@ -227,7 +226,7 @@ class DetailViewModel(application: Application) :
for (entry in byDisc.entries) {
val disc = entry.key
val discSongs = entry.value
data.add(DiscHeader(disc)) // Ensure ID uniqueness
data.add(DiscHeader(disc))
data.addAll(discSongs)
}
} else {

View file

@ -203,11 +203,16 @@ class GenreDetailFragment :
}
private fun updatePlayback(song: Song?, parent: MusicParent?, isPlaying: Boolean) {
if (parent is Genre && parent == unlikelyToBeNull(detailModel.currentGenre.value)) {
detailAdapter.updateIndicator(song, isPlaying)
} else {
// Ignore song playback not from the genre
detailAdapter.updateIndicator(null, isPlaying)
var item: Item? = null
if (parent is Artist) {
item = parent
}
if (parent is Genre && parent.uid == unlikelyToBeNull(detailModel.currentGenre.value).uid) {
item = song
}
detailAdapter.updateIndicator(item, isPlaying)
}
}