mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-05-20 17:21:22 +03:00
Apply 1 suggestion(s) to 1 file(s)
This commit is contained in:
parent
8d43b935ab
commit
eab55a7837
@ -181,9 +181,11 @@ class MediaPlayerManager(
|
||||
|
||||
createMediaController(onCreated)
|
||||
|
||||
rxBusSubscription += RxBus.activeServerChangingObservable.subscribe { oldServer ->
|
||||
// Even though Rx should launch on the main thread it doesn't always :(
|
||||
mainScope.launch {
|
||||
rxBusSubscription +=
|
||||
RxBus
|
||||
.activeServerChangingObservable
|
||||
.subscribeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe { oldServer ->
|
||||
if (oldServer != OFFLINE_DB_ID) {
|
||||
// When the server changes, the playlist can retain the downloaded songs.
|
||||
// Incomplete songs should be removed as the new server won't recognise them.
|
||||
@ -196,7 +198,6 @@ class MediaPlayerManager(
|
||||
switchToLocalPlayer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rxBusSubscription += RxBus.activeServerChangedObservable.subscribe {
|
||||
val jukebox = activeServerProvider.getActiveServer().jukeboxByDefault
|
||||
|
Loading…
x
Reference in New Issue
Block a user