don’t check if files exists when loading attachments

This commit is contained in:
Daniel Gultsch 2019-01-10 17:43:09 +01:00
parent 52afcac230
commit a644b40c3e
1 changed files with 2 additions and 7 deletions

View File

@ -518,13 +518,8 @@ public class FileBackend {
List<Attachment> attachments = new ArrayList<>();
for(DatabaseBackend.FilePath relativeFilePath : relativeFilePaths) {
final String mime = MimeUtils.guessMimeTypeFromExtension(MimeUtils.extractRelevantExtension(relativeFilePath.path));
Log.d(Config.LOGTAG,"mime="+mime);
File file = getFileForPath(relativeFilePath.path, mime);
if (file.exists()) {
attachments.add(Attachment.of(relativeFilePath.uuid, file,mime));
} else {
Log.d(Config.LOGTAG,"file "+file.getAbsolutePath()+" doesnt exist");
}
final File file = getFileForPath(relativeFilePath.path, mime);
attachments.add(Attachment.of(relativeFilePath.uuid, file, mime));
}
return attachments;
}