mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 14:27:57 +01:00 
			
		
		
		
	Download from up to 5 different sources concurrently (closes #2534)
(cherry picked from commit c9035b5df9)
			
			
This commit is contained in:
		| @@ -181,7 +181,16 @@ class Downloader( | ||||
|         subscriptions.clear() | ||||
|  | ||||
|         subscriptions += downloadsRelay.concatMapIterable { it } | ||||
|             .concatMap { downloadChapter(it).subscribeOn(Schedulers.io()) } | ||||
|             // Concurrently download from 5 different sources | ||||
|             .groupBy { it.source } | ||||
|             .flatMap( | ||||
|                 { bySource -> | ||||
|                     bySource.concatMap { download -> | ||||
|                         downloadChapter(download).subscribeOn(Schedulers.io()) | ||||
|                     } | ||||
|                 }, | ||||
|                 5 | ||||
|             ) | ||||
|             .onBackpressureBuffer() | ||||
|             .observeOn(AndroidSchedulers.mainThread()) | ||||
|             .subscribe( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user