mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 19:27:25 +01:00
Concurrently refresh trackers
This commit is contained in:
parent
f853158e6b
commit
40776bdc8d
@ -394,7 +394,7 @@ class BackupRestoreService : Service() {
|
|||||||
*/
|
*/
|
||||||
private fun trackingFetchObservable(manga: Manga, tracks: List<Track>): Observable<Track> {
|
private fun trackingFetchObservable(manga: Manga, tracks: List<Track>): Observable<Track> {
|
||||||
return Observable.from(tracks)
|
return Observable.from(tracks)
|
||||||
.concatMap { track ->
|
.flatMap { track ->
|
||||||
val service = trackManager.getService(track.sync_id)
|
val service = trackManager.getService(track.sync_id)
|
||||||
if (service != null && service.isLogged) {
|
if (service != null && service.isLogged) {
|
||||||
service.refresh(track)
|
service.refresh(track)
|
||||||
|
@ -58,7 +58,7 @@ class TrackPresenter(
|
|||||||
refreshSubscription?.let { remove(it) }
|
refreshSubscription?.let { remove(it) }
|
||||||
refreshSubscription = Observable.from(trackList)
|
refreshSubscription = Observable.from(trackList)
|
||||||
.filter { it.track != null }
|
.filter { it.track != null }
|
||||||
.concatMap { item ->
|
.flatMap { item ->
|
||||||
item.service.refresh(item.track!!)
|
item.service.refresh(item.track!!)
|
||||||
.flatMap { db.insertTrack(it).asRxObservable() }
|
.flatMap { db.insertTrack(it).asRxObservable() }
|
||||||
.map { item }
|
.map { item }
|
||||||
|
Loading…
Reference in New Issue
Block a user