mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
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:
parent
70b19754fb
commit
a003e9706f
8 changed files with 28 additions and 88 deletions
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue