mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Fix regression in file extension
We were appending a file extension and then throwing it away since some refactoring. Oops!
This commit is contained in:
parent
c3600f6eed
commit
4af8e15fb7
1 changed files with 7 additions and 7 deletions
|
|
@ -29,7 +29,13 @@ public class StartUploadTask extends AsyncTask<Void, Void, Contribution> {
|
|||
|
||||
app = (CommonsApplication)context.getApplicationContext();
|
||||
|
||||
contribution = new Contribution(mediaUri, null, rawTitle, description, -1, null, null, app.getCurrentAccount().name, CommonsApplication.DEFAULT_EDIT_SUMMARY);
|
||||
String title = rawTitle;
|
||||
String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType);
|
||||
if(extension != null && !title.toLowerCase().endsWith(extension.toLowerCase())) {
|
||||
title += "." + extension;
|
||||
}
|
||||
|
||||
contribution = new Contribution(mediaUri, null, title, description, -1, null, null, app.getCurrentAccount().name, CommonsApplication.DEFAULT_EDIT_SUMMARY);
|
||||
contribution.setTag("mimeType", mimeType);
|
||||
contribution.setSource(source);
|
||||
}
|
||||
|
|
@ -70,12 +76,6 @@ public class StartUploadTask extends AsyncTask<Void, Void, Contribution> {
|
|||
}
|
||||
|
||||
String mimeType = (String)contribution.getTag("mimeType");
|
||||
String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType);
|
||||
|
||||
if(extension != null && !title.toLowerCase().endsWith(extension.toLowerCase())) {
|
||||
title += "." + extension;
|
||||
}
|
||||
|
||||
if(mimeType.startsWith("image/") && contribution.getDateCreated() == null) {
|
||||
Cursor cursor = context.getContentResolver().query(contribution.getLocalUri(),
|
||||
new String[]{MediaStore.Images.ImageColumns.DATE_TAKEN}, null, null, null);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue