detail: add playing indicator to genre artists
Add playing indicators to artists within the genre detail view.
This commit is contained in:
parent
aa50c82635
commit
d764cc7c4e
2 changed files with 11 additions and 7 deletions
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue