Twelve: Make availableCommands a variable

Change-Id: Id6674574174b4adef28ca5950f783af74a010845
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/NowPlayingFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/NowPlayingFragment.kt
index efc4d3f..58962a1 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/NowPlayingFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/NowPlayingFragment.kt
@@ -387,7 +387,7 @@
                 }
 
                 launch {
-                    viewModel.availableCommands().collectLatest {
+                    viewModel.availableCommands.collectLatest {
                         it?.let {
                             playbackSpeedMaterialButton.isVisible =
                                 it.contains(Player.COMMAND_SET_SPEED_AND_PITCH)
diff --git a/app/src/main/java/org/lineageos/twelve/viewmodels/TwelveViewModel.kt b/app/src/main/java/org/lineageos/twelve/viewmodels/TwelveViewModel.kt
index 198d742..1020766 100644
--- a/app/src/main/java/org/lineageos/twelve/viewmodels/TwelveViewModel.kt
+++ b/app/src/main/java/org/lineageos/twelve/viewmodels/TwelveViewModel.kt
@@ -208,7 +208,7 @@
         )
 
     @OptIn(ExperimentalCoroutinesApi::class)
-    fun availableCommands() = mediaController
+    val availableCommands = mediaController
         .filterNotNull()
         .flatMapLatest { it.availableCommandsFlow() }
         .flowOn(Dispatchers.Main)