mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Fix network on main exception trying to play theme songs (#111)
Fetch the theme song info on the IO thread This would throw an exception on some devices, but it would be caught without affecting the app, other than just not playing theme music.
This commit is contained in:
parent
84ee57225b
commit
f76556f90e
3 changed files with 19 additions and 18 deletions
|
|
@ -3,12 +3,12 @@ package com.github.damontecres.wholphin.util
|
|||
import android.content.Context
|
||||
import android.widget.Toast
|
||||
import com.github.damontecres.wholphin.hilt.IoCoroutineScope
|
||||
import com.github.damontecres.wholphin.ui.launchIO
|
||||
import com.github.damontecres.wholphin.ui.showToast
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.launch
|
||||
import org.jellyfin.sdk.api.client.ApiClient
|
||||
import org.jellyfin.sdk.api.client.extensions.sessionApi
|
||||
import org.jellyfin.sdk.api.sockets.subscribe
|
||||
|
|
@ -32,7 +32,7 @@ class ServerEventListener
|
|||
}
|
||||
|
||||
fun init() {
|
||||
scope.launch(ExceptionHandler()) {
|
||||
scope.launchIO {
|
||||
api.sessionApi.postCapabilities(
|
||||
playableMediaTypes = listOf(MediaType.VIDEO),
|
||||
supportedCommands =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue