Skip to content
Snippets Groups Projects
Commit 53fe49ab authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Streams: Fix crash when playing audio

Fix #1249
parent 1b7e4dd7
No related branches found
No related tags found
Loading
Pipeline #15476 failed with stage
in 21 minutes and 6 seconds
......@@ -44,6 +44,10 @@ class StreamsModel(context: Context, coroutineContextProvider: CoroutineContextP
val observableSearchText = ObservableField<String>()
var service: PlaybackService? = null
private val serviceCb = object : PlaybackService.Callback by EmptyPBSCallback {
override fun update() = refresh()
}
init {
if (medialibrary.isStarted) refresh()
PlaybackService.serviceFlow.onEach { onServiceChanged(it) }.launchIn(viewModelScope)
......@@ -81,12 +85,6 @@ class StreamsModel(context: Context, coroutineContextProvider: CoroutineContextP
}
}
private val serviceCb = object : PlaybackService.Callback by EmptyPBSCallback {
override fun update() {
refresh()
}
}
class Factory(private val context: Context) : ViewModelProvider.Factory {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
@Suppress("UNCHECKED_CAST")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment