Skip to content

Commit

Permalink
return None in get_asin() if the book doesn't have any ASIN record
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyzz committed May 21, 2021
1 parent 732fb6a commit 2711420
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from calibre.customize import InterfaceActionBase

VERSION = (3, 7, 1)
VERSION = (3, 7, 2)


class WordDumbDumb(InterfaceActionBase):
Expand Down
6 changes: 3 additions & 3 deletions metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def get_asin(book_path, book_fmt):
else:
with open(book_path, 'rb') as f:
mu = MetadataUpdater(f)
if (asin := mu.original_exth_records.get(113, None)) is None:
asin = mu.original_exth_records.get(504, None)
return asin.decode('utf-8')
if (asin := mu.original_exth_records.get(113)) is None:
asin = mu.original_exth_records.get(504)
return asin.decode('utf-8') if asin else None
return None


Expand Down

0 comments on commit 2711420

Please sign in to comment.