Skip to content

Commit

Permalink
Fix inconsistent capitalisation of downloaded files
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-kolb committed Mar 14, 2020
1 parent 209d336 commit 45e2c84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
### Fixed

- We fixed an issue where opening a library from the recent libraries menu was not possible. [#5939](https://github.com/JabRef/jabref/issues/5939)
- We fixed an issue where opening a library from the recent libraries menu was not possible [#5939](https://github.com/JabRef/jabref/issues/5939)
- We fixed an issue with inconsistent capitalization of file extensions when downloading files [#6115](https://github.com/JabRef/jabref/issues/6115)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,10 @@ public BackgroundTask<Path> prepareDownloadTask(Path targetDirectory, URLDownloa
BackgroundTask<Path> downloadTask = BackgroundTask
.wrap(() -> {
Optional<ExternalFileType> suggestedType = inferFileType(urlDownload);
String suggestedTypeName = suggestedType.orElse(StandardExternalFileType.PDF).getName();
ExternalFileType externalFileType = suggestedType.orElse(StandardExternalFileType.PDF);
String suggestedTypeName = externalFileType.getName();
linkedFile.setFileType(suggestedTypeName);

String suggestedName = linkedFileHandler.getSuggestedFileName(suggestedTypeName);
String suggestedName = linkedFileHandler.getSuggestedFileName(externalFileType.getExtension());
return targetDirectory.resolve(suggestedName);
})
.then(destination -> new FileDownloadTask(urlDownload.getSource(), destination))
Expand Down

0 comments on commit 45e2c84

Please sign in to comment.