Do not use erroneous thumb url util function (#2901)

* Do not use erroneous thumb url util function

* Remove unused code

* Fix image loading for peer review

* Clear disposable
This commit is contained in:
Vivek Maskara 2019-04-20 15:03:52 +05:30 committed by Ashish Kumar
parent 70b19754fb
commit a003e9706f
8 changed files with 28 additions and 88 deletions

View file

@ -8,26 +8,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MediaDataExtractorUtil {
/**
* We could fetch all category links from API, but we actually only want the ones
* directly in the page source so they're editable. In the future this may change.
*
* @param source wikitext source code
*/
public static ArrayList<String> extractCategories(String source) {
ArrayList<String> categories = new ArrayList<>();
Pattern regex = Pattern.compile("\\[\\[\\s*Category\\s*:([^]]*)\\s*\\]\\]", Pattern.CASE_INSENSITIVE);
Matcher matcher = regex.matcher(source);
while (matcher.find()) {
String cat = matcher.group(1).trim();
categories.add(cat);
}
return categories;
}
/**
* Extracts a list of categories from | separated category string
*