mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
parent
624d351d4b
commit
b208b3d7fd
1 changed files with 8 additions and 0 deletions
|
|
@ -9,6 +9,8 @@ import androidx.annotation.Nullable;
|
|||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.wikipedia.dataclient.mwapi.MwQueryPage;
|
||||
import org.wikipedia.gallery.ExtMetadata;
|
||||
|
|
@ -27,6 +29,7 @@ import java.util.Map;
|
|||
import fr.free.nrw.commons.location.LatLng;
|
||||
import fr.free.nrw.commons.utils.CommonsDateUtil;
|
||||
import fr.free.nrw.commons.utils.MediaDataExtractorUtil;
|
||||
import timber.log.Timber;
|
||||
|
||||
@Entity
|
||||
public class Media implements Parcelable {
|
||||
|
|
@ -233,6 +236,11 @@ public class Media implements Parcelable {
|
|||
* @return file name as a string
|
||||
*/
|
||||
public String getFilename() {
|
||||
try {
|
||||
return URLEncoder.encode(filename,"utf-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Timber.e(e);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue