mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
#3810 Convert DepictedImagesFragment to use Pagination - map to empty result with no pages
This commit is contained in:
parent
310c29c2bd
commit
48b3002d05
1 changed files with 8 additions and 5 deletions
|
|
@ -138,11 +138,14 @@ class MediaClient @Inject constructor(
|
|||
}
|
||||
|
||||
private fun mediaFromPageAndEntity(pages: List<MwQueryPage>): Single<List<Media>> {
|
||||
return getEntities(pages.map { "$PAGE_ID_PREFIX${it.pageId()}" })
|
||||
.map {
|
||||
pages.zip(it.entities().values)
|
||||
.map { (page, entity) -> mediaConverter.convert(page, entity) }
|
||||
}
|
||||
return if (pages.isEmpty())
|
||||
Single.just(emptyList())
|
||||
else
|
||||
getEntities(pages.map { "$PAGE_ID_PREFIX${it.pageId()}" })
|
||||
.map {
|
||||
pages.zip(it.entities().values)
|
||||
.map { (page, entity) -> mediaConverter.convert(page, entity) }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue