Author merge endpoint should show the first few lines of the author's description
Currently, when doing an author merge, it can be easy to merge authors that share a common name:
But these should not be merged! The description of the first author is:
Rev. Archibald Alexander was a British clergyman. He is not to be confused with the theologian of the same name, active in the early 1800s and professor at Princeton Theological Seminary.
Including the first... say 250 characters of the description in this form will help librarians disambiguate authors, and avoid accidentally merging folks that shouldn't be merged.
Expected behaviour / screenshots (ex: Figma design screenshots for UI feature)
Adding this description here should do nicely! Add a <p> element just before the <ul> of books, or write No description.
Related files
-
https://github.com/internetarchive/openlibrary/blob/7592a6186153fab65eb55abcb5b00e9052dca71b/openlibrary/templates/merge/authors.html#L89
-
Use the truncate macro:
$macros.TruncateString(a.description, 250)
Stakeholders
@RayBB @davidscotson @purplem00n
Note: Before making a new branch or updating an existing one, please ensure your branch is up to date.
May I work on this?
@louisv20 you're assigned.
@cdrini how would you feel about either:
- Always showing the Wikidata short description too.
- Only showing Wikidata short description when there is no OL author description?
I've been unable to install openlibrary. Followed installation instructions and watched video. Any assistance would be appreciated.
Running into errors when building olbase image
Hmm you shouldn't need to run that command @louisv20 ; where did you see it?
The instructions here are the ones you want: https://github.com/internetarchive/openlibrary/blob/master/docker/README.md
Hmm you shouldn't need to run that command @louisv20 ; where did you see it?
The instructions here are the ones you want: https://github.com/internetarchive/openlibrary/blob/master/docker/README.md
Thanks, I will try that.
Got instructions from video tutorial at the bottom of openlibrary's main page
Ah it seems like that video has fallen out of date! Good find. The written instructions I linked to are our new methods. Let us know if you hit any issues with those!
Would you mind creating a new issue saying the video in the readme is out of date? Thank you!
Ah it seems like that video has fallen out of date! Good find. The written instructions I linked to are our new methods. Let us know if you hit any issues with those!
Would you mind creating a new issue saying the video in the readme is out of date? Thank you!
I was able to complete the installation successfully, thank you.
I also created a new issue for the video tutorial #9434
Question. How can I recreate an author merge scenario in development version? I've tried searching for the author mentioned in the example above but I get no hits.
@louisv20, you can use copydocs.py to copy production data to your local developer instance. The author IDs are a bit small in the screenshots, but here it would be something like:
$ docker compose web exec bash
WARN[0000] The "HOST" variable is not set. Defaulting to a blank string.
openlibrary@af88db9ddf59:/openlibrary$ PYTHONPATH=. ./scripts/copydocs.py /authors/OL2102479A /authors/OL2851848A
fetching ['/authors/OL2102479A', '/authors/OL2851848A']
saving ['/authors/OL2102479A', '/authors/OL2851848A']
[{'key': '/authors/OL2102479A', 'revision': 1}, {'key': '/authors/OL2851848A', 'revision': 1}]
From there, after a minute or two (or three...), you'll be able search for archibald and they'll both show up.
Once they're visible in the search results, you can click on each author's name and select them for merging (see the bottom right):
This should get you to the point @cdrini shared in the original screenshot, minus the books (which you could copy in if you wanted, using copydocs.py, but they shouldn't be relevant here).
Is the author's description automatically fetched with the author?
I'm able to get the "No description" text under each author but description isn't fetched.
code that was added to openlibrary/openlibrary/templates/merge/authors.html
@louisv20 trying a.bio instead of a.description
FW(little)IW:
Always showing the Wikidata short description too.
I’d be in favour of this. The more information provided at merge time, the better. :) This might be better for a separate issue, though, as the UI might be desired to be different (e.g., maybe show it in grey next to the years rather than in the spot of the bio/description?) – and also just to keep issues (and thus PRs and commits) a bit more atomic.