internetarchive / internetarchive/openlibrary

Data integrity: Internet Archive ID is 't' generating bad thumbnails in carousels

Open
#3,393 0 comments 0 reactions 0 assignees View on GitHub
Affects: UI Lead: @mekarpeles Priority: 3 Type: Bug
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
138

Description

This relates to the slack conversation between @mekarpeles and Brittany. For those who missed it, apparently this fix is not applying to:
https://openlibrary.org/subjects/in_library#ebooks=true&sort=edition_count
when you click right arrow.

The carousel item is rendered on the server side so this is likely an issue in the template.

The template uses the following code
If an Internet Archive ID is available that's used here.
```
$elif book.get('ia'):
$ cover_url = '%s/b/ia/%s-M.jpg?default=%s'%(cover_host, book.get('ia')[0], fallback_cover)
```

For some reason some books have an inaccurate `ia` field. When that happens a bad URI is created like //covers.openlibrary.org/b/ia/t-M.jpg?default=https://openlibrary.org/images/icons/avatar_book.png

The template is dumb and will assume if it finds an image a cover exists. ie. It;s the default parameter in the covers api that is causing an issue.

The covers api takes a default parameter.

Two solutions to this
1) Either we cannot depend on the IA field and we should not ever use it for the thumbnail
2) API should be updated to 404 when an image is not available so alt text can be used.

```

```
### Evidence / Screenshot (if possible)
Screen Shot 2020-04-21 at 9 56 54 PM

###

### Related

Very similar to #2836 possibly can be fixed at the same time.

### Stakeholders

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.