Fix book link

This commit is contained in:
Óscar M. Lage 2024-10-10 14:31:03 +02:00
parent ce99b3a3c6
commit 0920771bbf

View File

@ -48,7 +48,7 @@ func SearchBookByTitle(title string, book *Book) error {
book.ID = items[0].(map[string]interface{})["id"].(string)
book.Title = bookInfo["title"].(string)
book.Author = bookInfo["authors"].([]interface{})[0].(string)
book.Link = bookInfo["infoLink"].(string)
book.Link = items[0].(map[string]interface{})["selfLink"].(string)
if pageCount, ok := bookInfo["pageCount"].(float64); ok {
book.Pages = int(pageCount)
}