Skip to content

Commit 45e2c84

Browse files
committed
Fix inconsistent capitalisation of downloaded files
Fixes JabRef#6115
1 parent 209d336 commit 45e2c84

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
2020
### Fixed
2121

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

2426
### Removed
2527

src/main/java/org/jabref/gui/fieldeditors/LinkedFileViewModel.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,10 @@ public BackgroundTask<Path> prepareDownloadTask(Path targetDirectory, URLDownloa
421421
BackgroundTask<Path> downloadTask = BackgroundTask
422422
.wrap(() -> {
423423
Optional<ExternalFileType> suggestedType = inferFileType(urlDownload);
424-
String suggestedTypeName = suggestedType.orElse(StandardExternalFileType.PDF).getName();
424+
ExternalFileType externalFileType = suggestedType.orElse(StandardExternalFileType.PDF);
425+
String suggestedTypeName = externalFileType.getName();
425426
linkedFile.setFileType(suggestedTypeName);
426-
427-
String suggestedName = linkedFileHandler.getSuggestedFileName(suggestedTypeName);
427+
String suggestedName = linkedFileHandler.getSuggestedFileName(externalFileType.getExtension());
428428
return targetDirectory.resolve(suggestedName);
429429
})
430430
.then(destination -> new FileDownloadTask(urlDownload.getSource(), destination))

0 commit comments

Comments
 (0)