mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
This reverts commit 3c9b7ba7a8.
This commit is contained in:
parent
3c9b7ba7a8
commit
c8a58bfc2e
9 changed files with 6 additions and 137 deletions
|
|
@ -3,7 +3,6 @@ package fr.free.nrw.commons.mwapi;
|
|||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
|
|
@ -304,26 +303,6 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
|
|||
.getString("/api/flow-parsoid-utils/@content"));
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches the Caption of the file with a given name.
|
||||
* @param filename title of the file
|
||||
* @return a single with media caption
|
||||
*/
|
||||
@Override
|
||||
public Single<String> fetchCaptionByFilename(String filename) {
|
||||
return Single.fromCallable(() -> {
|
||||
CustomApiResult apiResult = api.action("wbgetentities")
|
||||
.param("sites", "commonswiki")
|
||||
.param("titles", filename)
|
||||
.param("props", "labels")
|
||||
.param("format", "xml")
|
||||
.param("languages", Locale.getDefault().getLanguage())
|
||||
.param("languagefallback", "1")
|
||||
.get();
|
||||
return apiResult.getString("/api/entities/entity/labels/label/@value");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public Single<MediaResult> fetchMediaByFilename(String filename) {
|
||||
|
|
|
|||
|
|
@ -66,8 +66,6 @@ public interface MediaWikiApi {
|
|||
|
||||
Single<String> parseWikicode(String source);
|
||||
|
||||
Single<String> fetchCaptionByFilename(String filename);
|
||||
|
||||
@NonNull
|
||||
Single<MediaResult> fetchMediaByFilename(String filename);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue