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

View file

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