Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ public void execute() {
}
}

Task<Map<Optional<URL>, BibEntry>> findFullTextsTask = new Task<Map<Optional<URL>, BibEntry>>() {
Task<Map<BibEntry, Optional<URL>>> findFullTextsTask = new Task<Map<BibEntry, Optional<URL>>>() {
@Override
protected Map<Optional<URL>, BibEntry> call() {
Map<Optional<URL>, BibEntry> downloads = new ConcurrentHashMap<>();
protected Map<BibEntry, Optional<URL>> call() {
Map<BibEntry, Optional<URL>> downloads = new ConcurrentHashMap<>();
int count = 0;
for (BibEntry entry : basePanel.getSelectedEntries()) {
FulltextFetchers fetchers = new FulltextFetchers(Globals.prefs.getImportFormatPreferences());
downloads.put(fetchers.findFullTextPDF(entry), entry);
downloads.put(entry, fetchers.findFullTextPDF(entry));
updateProgress(++count, basePanel.getSelectedEntries().size());
}
return downloads;
Expand All @@ -93,10 +93,10 @@ protected Map<Optional<URL>, BibEntry> call() {
Globals.TASK_EXECUTOR.execute(findFullTextsTask);
}

private void downloadFullTexts(Map<Optional<URL>, BibEntry> downloads) {
for (Map.Entry<Optional<URL>, BibEntry> download : downloads.entrySet()) {
BibEntry entry = download.getValue();
Optional<URL> result = download.getKey();
private void downloadFullTexts(Map<BibEntry, Optional<URL>> downloads) {
for (Map.Entry<BibEntry, Optional<URL>> download : downloads.entrySet()) {
BibEntry entry = download.getKey();
Optional<URL> result = download.getValue();
if (result.isPresent()) {
Optional<Path> dir = basePanel.getBibDatabaseContext().getFirstExistingFileDir(Globals.prefs.getFilePreferences());

Expand Down