Bug 504586 - Open Library - Do not complete the author field for some books
Summary: Open Library - Do not complete the author field for some books
Status: RESOLVED FIXED
Alias: None
Product: tellico
Classification: Applications
Component: general (other bugs)
Version First Reported In: HEAD
Platform: Flatpak Linux
: NOR minor
Target Milestone: ---
Assignee: Robby Stephenson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-20 23:42 UTC by louise.ripley
Modified: 2025-05-25 20:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.1.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description louise.ripley 2025-05-20 23:42:23 UTC
SUMMARY
Author field not retrieved for some Open Library books

STEPS TO REPRODUCE
1. Create a new book collection
2. Add entry from Internet Search
3. Search "1-03070-596-8" or "2-35872-292-8"
   Search type : ISBN
   Search source : Open Library
4. The returned book does not contain the “Author” field.
   Yet the author is correctly entered in Open Library.
   And the API call returns the author field:
      https://openlibrary.org/search.json?isbn=1-03070-596-8
      https://openlibrary.org/search.json?isbn=2-35872-292-8
5. Tellico has no problem retrieving the author field for the book with the ISBN 0-7893-1223-9

SOFTWARE/OS VERSIONS
OS: Linux Mint 22.1 (Xia) - Cinnamon
Tellico: 4.1.2
KDE Frameworks: 6.13.0
Qt: Using 6.8.3 and built against 6.8.3
KDE Flatpak runtime (Xcb)
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.11.0-25-generic
Comment 1 Robby Stephenson 2025-05-22 00:36:24 UTC
(In reply to louise.ripley from comment #0)
> 4. The returned book does not contain the “Author” field.
>    Yet the author is correctly entered in Open Library.
>    And the API call returns the author field:
>       https://openlibrary.org/search.json?isbn=1-03070-596-8
>       https://openlibrary.org/search.json?isbn=2-35872-292-8

Thanks for the specific examples. It's interesting that the Query API returns different results than the Search API.
https://openlibrary.org/query.json?isbn_10=1030705968&type=/type/edition&*

I'll see if I can figure out what's going on.
Comment 2 louise.ripley 2025-05-22 23:27:35 UTC
Indeed, it's strange.
The root cause seems to be in the OpenLibrary API.

It's probably the same problem that means that for some books the list of authors is not the same between Query API and Search API.
For example, for the book with ISBN 235872081X, Query API retrieves authors OL8264985A and OL9108379A, whereas Search API retrieves authors OL8264985A and OL6953524A.
   https://openlibrary.org/query.json?isbn_10=235872081X&type=/type/edition&*
   https://openlibrary.org/search.json?isbn=235872081X

Furthermore, the page for author OL9108379A appears to have been deleted.
   https://openlibrary.org/authors/OL9108379A
Comment 3 Robby Stephenson 2025-05-25 16:26:48 UTC
(In reply to louise.ripley from comment #2)
> Indeed, it's strange.
> The root cause seems to be in the OpenLibrary API.
> 
> It's probably the same problem that means that for some books the list of
> authors is not the same between Query API and Search API.

It may just be that the authors are defined for the work and not the edition, per https://github.com/internetarchive/openlibrary/issues/8144. I'll add an extra API call to check, and investigate whether the Search API is better to use overall
Comment 4 Robby Stephenson 2025-05-25 16:31:48 UTC
Git commit 6bfc59a7bbab6426eec5d9e943c825168a485e83 by Robby Stephenson.
Committed on 25/05/2025 at 16:31.
Pushed by rstephenson into branch '4.1'.

Update the OpenLibrary source to fetch work author when needed

The Search API endpoint may be more appropriate for Tellico, given the
guidance in https://github.com/internetarchive/openlibrary/issues/8144
which would decrease the number of calls needed to fetch the full author
list.
FIXED-IN: 4.1.3

M  +4    -0    ChangeLog
M  +52   -5    src/fetch/openlibraryfetcher.cpp
M  +1    -0    src/fetch/openlibraryfetcher.h
M  +14   -3    src/tests/openlibraryfetchertest.cpp

https://invent.kde.org/office/tellico/-/commit/6bfc59a7bbab6426eec5d9e943c825168a485e83
Comment 5 Robby Stephenson 2025-05-25 17:25:28 UTC
Git commit 1dadad2a8030cdddb6772bf1f32a62a6ae0221c6 by Robby Stephenson.
Committed on 25/05/2025 at 16:48.
Pushed by rstephenson into branch 'master'.

Update the OpenLibrary source to fetch work author when needed

The Search API endpoint may be more appropriate for Tellico, given the
guidance in https://github.com/internetarchive/openlibrary/issues/8144
which would decrease the number of calls needed to fetch the full author
list.
FIXED-IN: 4.1.3

M  +4    -0    ChangeLog
M  +1    -0    TODO
M  +54   -5    src/fetch/openlibraryfetcher.cpp
M  +1    -0    src/fetch/openlibraryfetcher.h
M  +14   -3    src/tests/openlibraryfetchertest.cpp

https://invent.kde.org/office/tellico/-/commit/1dadad2a8030cdddb6772bf1f32a62a6ae0221c6
Comment 6 louise.ripley 2025-05-25 20:28:49 UTC
Thank you very much for the quick fix.

Just so you know, after your first message, I also opened a issue on the OpenLibrary github: https://github.com/internetarchive/openlibrary/issues/10851
They seem to have some bugs to fix on their side.