Set user name properly for multiple uploads!

This commit is contained in:
YuviPanda 2013-03-21 21:16:55 +05:30
parent c5ac1651aa
commit cad50fb4c6
2 changed files with 17 additions and 0 deletions

View file

@ -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;
}
}

View file

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