Currently the thumbnails of the books are generated in the following ways
- image of the book property
- title page number as qualifier of document file on Wikimedia Commons property.
But, still thumbnails could not be generated for many other books in the app as their Wikidata items are not filled with the above mentioned properties.
For that, a third option to generate thumbnail is needed, where the image of authors can be used as an alternative. The value of authors are already included in the Wsindex API
Task:
- Fetch image from the Wikidata items of the authors and include in the Wsindex API
- Fetch only one image if the Wikdiata item of an author has multiple images.
- Sometimes, the item of an author having multiple images have one image with preferred rank (see this item for example). Fetch that preferred image only.
- For item of an author having multiple images but which do not have preferred rank, fetch any one of the images.
[Note: Add the image url of authors in the Wsindex API in the authors section. The image url should also be of the lower resolution version from Wikimedia Commons (check how we are generating existing book thumbnails for example). ]
- For thumbnail generation on the app side
- Skip books which already uses the first two options of thumbnail generation and look for those books which do not. [Note: Use the author image url if thumbnail url is empty in API response.]
- For books with more than one value of authors, look for image of the first author in the item. .
- If the first author has image, add it as the thumbnail and do not check the next author.
- If the first author does not have image, skip and check the next author and repeat.