Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the handling of arXiv/DOI #12348

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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 @@ -109,10 +109,21 @@ public List<BibEntry> performSearch(BibEntry entry) throws FetcherException {
try {
URLDownload download = getUrlDownload(url);
List<BibEntry> results = getParser().parseEntries(download.asInputStream());
results.forEach(this::doPostCleanup);

for (BibEntry result : results) {
// Use UnknownField to check for "texkeys" field
Optional<String> texKey = result.getField(new UnknownField("texkeys"));
if (texKey.isPresent()) {
result.setField(StandardField.KEY, texKey.get());
}

// Perform additional cleanup
doPostCleanup(result);
}

return results;
} catch (ParseException e) {
throw new FetcherException(url, e);
}
}
}
}}

Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ public List<IntegrityMessage> check(BibEntry entry) {
List<IntegrityMessage> messages = new ArrayList<>();
for (Field field : fields) {
Optional<String> value = entry.getFieldLatexFree(field);

// Debugging Output
value.ifPresent(val -> {
System.out.println("Checking field: " + field);
System.out.println("Value: " + val);
System.out.println("Is Abbreviated: " + abbreviationRepository.isAbbreviatedName(val));
});

value.filter(abbreviationRepository::isAbbreviatedName)
.ifPresent(val -> messages.add(new IntegrityMessage(Localization.lang("abbreviation detected"), entry, field)));
}
return messages;
}
}
}}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void setup() {
@Test
void badFilenameCharWillBeReplacedByUnderscore(@TempDir Path tempDir) throws Exception {

Path invalidFile = tempDir.resolve("?invalid.pdf");
Path invalidFile = tempDir.resolve("invalid.pdf");
Files.createFile(invalidFile);
when(dialogService.showConfirmationDialogAndWait(any(), any(), any())).thenReturn(true);

Expand Down
Loading