mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
* #3813 Convert MediaClient to Kotlin - convert * #3813 Convert MediaClient to Kotlin - update tests * #3813 Convert MediaClient to Kotlin - fix List typing * #3813 Convert MediaClient to Kotlin - fix mock injecting
This commit is contained in:
parent
e3213aa5bd
commit
422890cac4
7 changed files with 319 additions and 302 deletions
|
|
@ -8,7 +8,6 @@ import fr.free.nrw.commons.media.MediaClient
|
|||
import io.reactivex.Scheduler
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import timber.log.Timber
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Named
|
||||
|
||||
|
|
@ -52,11 +51,11 @@ class ContributionBoundaryCallback @Inject constructor(
|
|||
* Fetches contributions using the MediaWiki API
|
||||
*/
|
||||
fun fetchContributions() {
|
||||
if (mediaClient.doesMediaListForUserHaveMorePages(sessionManager.userName).not()) {
|
||||
if (mediaClient.doesMediaListForUserHaveMorePages(sessionManager.userName!!).not()) {
|
||||
return
|
||||
}
|
||||
compositeDisposable.add(
|
||||
mediaClient.getMediaListForUser(sessionManager.userName)
|
||||
mediaClient.getMediaListForUser(sessionManager.userName!!)
|
||||
.map { mediaList: List<Media?> ->
|
||||
mediaList.map {
|
||||
Contribution(it, Contribution.STATE_COMPLETED)
|
||||
|
|
@ -86,4 +85,4 @@ class ContributionBoundaryCallback @Inject constructor(
|
|||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue