detail: fix album regressions

Fix the accidental navToItem breakage in AlbumDetailFragment.
This commit is contained in:
OxygenCobalt 2021-09-11 18:10:50 -06:00
parent 0e0be19e1d
commit cafd7d8ca6
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 3 additions and 2 deletions

View file

@ -155,9 +155,10 @@ class AlbumDetailFragment : DetailFragment() {
*/
private fun scrollToItem(id: Long, adapter: AlbumDetailAdapter) {
// Calculate where the item for the currently played song is
val pos = adapter.currentList.indexOfFirst { it.id == id && it is Album }
val pos = adapter.currentList.indexOfFirst { it.id == id && it is Song }
if (pos != -1) {
logD("IDIOT.")
binding.detailRecycler.post {
// Make sure to increment the position to make up for the detail header
binding.detailRecycler.layoutManager?.startSmoothScroll(

View file

@ -148,7 +148,7 @@ class AlbumDetailAdapter(
text = data.artist.name
setOnClickListener {
detailModel.navToItem(data)
detailModel.navToItem(data.artist)
}
}