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

Nothing happens creating entry from specific ISBN #7000

Closed
1 task done
crystalfp opened this issue Oct 11, 2020 · 4 comments · Fixed by #7036
Closed
1 task done

Nothing happens creating entry from specific ISBN #7000

crystalfp opened this issue Oct 11, 2020 · 4 comments · Fixed by #7036
Labels

Comments

@crystalfp
Copy link

JabRef 5.2--2020-10-07--4b1b7b4
Windows 10 10.0 amd64
Java 15

Creating entry from ISBN do nothing without any message stating the reason.

Steps to reproduce the behavior:

  1. Open the new entry dialog
  2. Select ID type: ISBN and enter the following ID: 88-17-21041-2
  3. Push Generate, nothing happens and no error message appears
  4. Same result from the newer ISBN: 9788817210416

The two ISBN are copied directly from the cover of the book. If for some reason they are invalid or not existent, I expect at least an error messages stating the reason. For other errors (I tried removing a digit and changing a digit) an error popup appears.

I search these ISBN on bookfinder.com and the book indeed exists.

Here is the full entry:

@Book{Sagan1985,
	author    = {Carl Sagan},
	title     = {Contact},
	date      = {1997-09},
	origdate  = {1985},
	publisher = {Rizzoli},
        location  = {Milano},
	isbn      = {88-17-21041-2},
        langid    = {italian},
}
@crystalfp
Copy link
Author

The same problem for ISBN: 9788845253119

@tmrd993
Copy link
Contributor

tmrd993 commented Oct 21, 2020

As far as I know, JabRef has two sources for ISBN fetching. This behaviour happens if the ISBN is valid, but the actual book isn't available at any of the two sources. An invalid ISBN actually has an exception thrown, that's what you are seeing when you remove or add digits to the ISBN.

@tmrd993
Copy link
Contributor

tmrd993 commented Oct 21, 2020

@Override
public Optional<BibEntry> performSearchById(String identifier) throws FetcherException {
if (StringUtil.isBlank(identifier)) {
return Optional.empty();
}
// remove any newlines and spaces.
identifier = NEWLINE_SPACE_PATTERN.matcher(identifier).replaceAll("");
IsbnViaEbookDeFetcher isbnViaEbookDeFetcher = new IsbnViaEbookDeFetcher(importFormatPreferences);
Optional<BibEntry> bibEntry = isbnViaEbookDeFetcher.performSearchById(identifier);
// nothing found at ebook.de: try ottobib
if (!bibEntry.isPresent()) {
LOGGER.debug("No entry found at ebook.de; trying ottobib");
IsbnViaOttoBibFetcher isbnViaOttoBibFetcher = new IsbnViaOttoBibFetcher(importFormatPreferences);
bibEntry = isbnViaOttoBibFetcher.performSearchById(identifier);
}

I think we could throw a FetcherException here if the bibEntry is still empty after trying ottobib? That more or less fixes it in my code.

@crystalfp
Copy link
Author

Any feedback to the user instead of nothing is a sorely needed thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants