Merge pull request #4529 from ByteHamster/fix-queue-loader-thread
Load queue in background thread
This commit is contained in:
commit
545ac4eda0
|
@ -84,6 +84,7 @@ import io.reactivex.Observable;
|
|||
import io.reactivex.Single;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
@ -315,7 +316,10 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||
}
|
||||
}
|
||||
emitter.onSuccess(queueItems);
|
||||
}).subscribe(queueItems -> mediaSession.setQueue(queueItems), Throwable::printStackTrace);
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(queueItems -> mediaSession.setQueue(queueItems), Throwable::printStackTrace);
|
||||
|
||||
flavorHelper.initializeMediaPlayer(PlaybackService.this);
|
||||
mediaSession.setActive(true);
|
||||
|
|
Loading…
Reference in New Issue