Greatly simplify scrobbling books

This commit is contained in:
2023-04-15 09:03:06 -04:00
parent f9dcc0d341
commit fb107c083f
3 changed files with 54 additions and 68 deletions

View File

@ -1,5 +1,6 @@
import json
import logging
from typing import Optional
import urllib
import requests
@ -74,7 +75,9 @@ def lookup_author_from_openlibrary(olid: str) -> dict:
}
def lookup_book_from_openlibrary(title: str, author: str = None) -> dict:
def lookup_book_from_openlibrary(
title: str, author: Optional[str] = None
) -> dict:
title_quoted = urllib.parse.quote(title)
author_quoted = ""
if author: