Revert "Fixes #2337 - Show captions of image in media details (conflicts fixed) (#2933)" (#2934)

This reverts commit 3c9b7ba7a8.
This commit is contained in:
Ashish Kumar 2019-05-01 16:10:43 +05:30 committed by GitHub
parent 3c9b7ba7a8
commit c8a58bfc2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 6 additions and 137 deletions

View file

@ -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) {

View file

@ -66,8 +66,6 @@ public interface MediaWikiApi {
Single<String> parseWikicode(String source);
Single<String> fetchCaptionByFilename(String filename);
@NonNull
Single<MediaResult> fetchMediaByFilename(String filename);