mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Set user name properly for multiple uploads!
This commit is contained in:
parent
c5ac1651aa
commit
cad50fb4c6
2 changed files with 17 additions and 0 deletions
|
|
@ -95,6 +95,10 @@ public class Media implements Parcelable {
|
|||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getThumbnailUrl(int width) {
|
||||
return Utils.makeThumbUrl(imageUrl, filename, width);
|
||||
}
|
||||
|
|
@ -149,4 +153,8 @@ public class Media implements Parcelable {
|
|||
creator = in.readString();
|
||||
tags = (HashMap<String, Object>)in.readSerializable();
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import android.database.Cursor;
|
|||
import android.net.*;
|
||||
import android.os.*;
|
||||
import android.provider.*;
|
||||
import android.text.TextUtils;
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
import java.io.*;
|
||||
|
|
@ -60,6 +61,14 @@ public class StartUploadTask extends AsyncTask<Void, Void, Contribution> {
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(contribution.getCreator())) {
|
||||
contribution.setCreator(app.getCurrentAccount().name);
|
||||
}
|
||||
|
||||
if(contribution.getDescription() == null) {
|
||||
contribution.setDescription("");
|
||||
}
|
||||
|
||||
String mimeType = (String)contribution.getTag("mimeType");
|
||||
String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue