mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-15 08:50:35 +03:00
Merge branch 'thread' into 'develop'
Ensure correct thread when accepting a rating See merge request ultrasonic/ultrasonic!1025
This commit is contained in:
commit
8c42700676
@ -142,13 +142,15 @@ class TrackViewHolder(val view: View) :
|
||||
|
||||
// Listen for rating updates
|
||||
rxBusSubscription!! += RxBus.ratingPublishedObservable.subscribe {
|
||||
// Ignore updates which are not for the current song
|
||||
if (it.id != song.id) return@subscribe
|
||||
launch(Dispatchers.Main) {
|
||||
// Ignore updates which are not for the current song
|
||||
if (it.id != song.id) return@launch
|
||||
|
||||
if (it.rating is HeartRating) {
|
||||
updateSingleStar(it.rating.isHeart)
|
||||
} else if (it.rating is StarRating) {
|
||||
updateFiveStars(it.rating.starRating.toInt())
|
||||
if (it.rating is HeartRating) {
|
||||
updateSingleStar(it.rating.isHeart)
|
||||
} else if (it.rating is StarRating) {
|
||||
updateFiveStars(it.rating.starRating.toInt())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user