-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add support for book front covers #14330
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
base: main
Are you sure you want to change the base?
Conversation
…book-front-cover-10120
…ded experimental "covers" subfolder
Hey @bblhd!Thank you for contributing to JabRef! Your help is truly appreciated ❤️. We have automatic checks in place, based on which you will soon get automated feedback if any of them are failing. We also use TragBot with custom rules that scans your changes and provides some preliminary comments, before a maintainer takes a look. TragBot is still learning, and may not always be accurate. In the "Files changed" tab, you can go through its comments and just click on "Resolve conversation" if you are sure that it is incorrect, or comment on the conversation if you are doubtful. Please re-check our contribution guide in case of any other doubts related to our contribution workflow. |
jabgui/src/main/java/org/jabref/gui/importer/BookCoverFetcher.java
Outdated
Show resolved
Hide resolved
|
I have attempted to unmodify submodules without success, both in the past and currently, though I was unaware how much of a problem it was. I've tried all suggested fixes unsuccessfully, either commit ids are not found or the commands have no effect at all. It seems to be something wrong with my version of git or my repository. For context, I'm using git version 2.51.2_1, on linux, with a basic command line and no IDE. In theory, this could be fixed by creating a new branch and pull request, but the contributors guide specifically requests not to. Does anyone know how to solve this? Commit: bb58664 |
Fixed this by doing submodule checkout in IntelliJ IDEA, unsure what exactly the issue was, but submodules are now unmodified from main. |
0b644fd to
2c61ef3
Compare
|
I apologise for force pushing, the only difference was a single incorrect author email in the previous commit I pushed. |
|
Hi, bblhd! Thank you for looking into this feature. This is a very good issue for the first contribution! |
…java Co-authored-by: Oliver Kopp <[email protected]>
Nice! - Yeah, we are hitting the trade-off between 100% crisp requirements (causing much time) and implementing a solution and needed to change based on feedback. -- Its always easier to see something when it is "tangible" than when it is written somehow vaguely. Thank you for the endurance! If you want, you can write down an ADR (docs/decisions), because you know have material for both options. |
| if (isbn.isPresent()) { | ||
| final String name = "isbn-" + isbn.asString(); | ||
| final String name = "isbn-" + isbn.get().asString(); | ||
| if (findExistingImage(name, directory).isEmpty()) { | ||
| final String url = getSourceForIsbn(isbn); | ||
| final String url = getSourceForIsbn(isbn.get()); | ||
| Optional<LinkedFile> file = downloadCoverImage(url, name, directory); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please get used to .map for optionals. At the end, you can do forEach as you don't need the resulting downloaded file at this place.
|
JUnit tests of You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide. |
Closes #10120
This pull request adds support for cover images which can display in the preview of entries. It also allows new entries to automatically download cover images from either "https://bookcover.longitood.com" or "https://covers.openlibrary.org", and preferences to control downloading behaviour. Key changes are:
PreviewViewerto display imagesBookCoverFetcherclass to download cover imagesNewEntryViewModelto do cover fetchingFilePreferencesandLinkedFilesTabSteps to test
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)Images