JohnSmithDev / ISFDB-Tools

Tools to query a local copy of the ISFDB database
5 stars 1 forks source link

award_vs_publication_dates: some books get missed #2

Closed JohnSmithDev closed 5 years ago

JohnSmithDev commented 5 years ago

Example (warning lines only shown):

isfdb_tools $ ./award_vs_publication_dates.py -W 'Hugo Award' -C 'Best Novel' -y 2015-2019 -v WARNING:root:Could not find title_id for "The Three-Body Problem/Cixin Liu" - ignoring WARNING:root:Could not find title_id for "The Goblin Emperor/Katherine Addison" - ignoring WARNING:root:No author and/or title for title "No Award/" - ignoring WARNING:root:Could not find title_id for "Death's End/Cixin Liu" - ignoring WARNING:root:Multiple title_ids found for "Spinning Silver/Naomi Novik" ({2088501: AuthorBook(author='Naomi Novik', book='Spinning Silver'), 2370764: AuthorBook(author='Naomi Novik', book='Spinning Silver')})- ignoring

AFAIK newer award script award_countries.py doesn't suffer this problem, so I should do whatever that script does - ideally some sort of refactoring so that common code can be shared, although possibly that could be awkward if the underlying SQL queries are too different.

JohnSmithDev commented 5 years ago

Thinking about it - award_countries doesn't care about the books/titles, which is presumably why it doesn't have those issues.

JohnSmithDev commented 5 years ago

This is now fixed - title_id is included in the awards table, so just get it directly from there rather than doing a hacky and error-prone lookup.