mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-03 08:13:55 +01:00
parent
01839dec6e
commit
de3377c0fe
16 changed files with 99 additions and 84 deletions
|
|
@ -171,7 +171,7 @@ public class MediaClient {
|
|||
* @return caption for image using wikibaseIdentifier
|
||||
*/
|
||||
public Single<String> getCaptionByWikibaseIdentifier(String wikibaseIdentifier) {
|
||||
return mediaDetailInterface.getCaptionForImage(Locale.getDefault().getLanguage(), wikibaseIdentifier)
|
||||
return mediaDetailInterface.getEntityForImage(Locale.getDefault().getLanguage(), wikibaseIdentifier)
|
||||
.map(mediaDetailResponse -> {
|
||||
if (isSuccess(mediaDetailResponse)) {
|
||||
for (Entity wikibaseItem : mediaDetailResponse.entities().values()) {
|
||||
|
|
|
|||
|
|
@ -33,5 +33,5 @@ public interface MediaDetailInterface {
|
|||
* @param wikibaseIdentifier pageId for the media
|
||||
*/
|
||||
@GET("/w/api.php?action=wbgetentities&props=labels&format=json&languagefallback=1&sites=commonswiki")
|
||||
Observable<Entities> getCaptionForImage(@Query("languages") String language, @Query("ids") String wikibaseIdentifier);
|
||||
Observable<Entities> getEntityForImage(@Query("languages") String language, @Query("ids") String wikibaseIdentifier);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue