mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
add item menus to the detail screens and now playing
Album, artist and playlist detail screens get a more button plus long-press on their song and album rows; now playing gets a more button for the current song. Song menus can reach the album and artist and star; the now-playing song is read from Room so its star state is current.
This commit is contained in:
@@ -8,6 +8,7 @@ import com.subtracks.data.model.Disc
|
||||
import com.subtracks.data.model.Song
|
||||
import com.subtracks.data.repo.LibraryRepository
|
||||
import com.subtracks.data.repo.SourceRepository
|
||||
import com.subtracks.data.source.StarType
|
||||
import com.subtracks.playback.PlaybackController
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
@@ -53,4 +54,12 @@ class AlbumDetailViewModel(
|
||||
playbackController.shuffleAlbum(sourceId.first(), albumId)
|
||||
}
|
||||
}
|
||||
|
||||
fun setStar(
|
||||
type: StarType,
|
||||
id: String,
|
||||
starred: Boolean,
|
||||
) {
|
||||
viewModelScope.launch { libraryRepository.setStar(type, id, starred) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user