mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +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,7 +138,10 @@ class MediaClient @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun mediaFromPageAndEntity(pages: List<MwQueryPage>): Single<List<Media>> {
|
private fun mediaFromPageAndEntity(pages: List<MwQueryPage>): Single<List<Media>> {
|
||||||
return getEntities(pages.map { "$PAGE_ID_PREFIX${it.pageId()}" })
|
return if (pages.isEmpty())
|
||||||
|
Single.just(emptyList())
|
||||||
|
else
|
||||||
|
getEntities(pages.map { "$PAGE_ID_PREFIX${it.pageId()}" })
|
||||||
.map {
|
.map {
|
||||||
pages.zip(it.entities().values)
|
pages.zip(it.entities().values)
|
||||||
.map { (page, entity) -> mediaConverter.convert(page, entity) }
|
.map { (page, entity) -> mediaConverter.convert(page, entity) }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue