Skip to content

Commit

Permalink
Gracefully deal with incorrect dates
Browse files Browse the repository at this point in the history
  • Loading branch information
AnonTester committed Apr 11, 2022
1 parent 2d0af0a commit adf6728
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cps/editbooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,9 +983,9 @@ def create_book_on_upload(modify_date, meta):
# combine path and normalize path from Windows systems
path = os.path.join(author_dir, title_dir).replace('\\', '/')

if meta.pubdate != "":
try:
pubdate = datetime.strptime(meta.pubdate[:10], "%Y-%m-%d")
else:
except:
pubdate = datetime(101, 1, 1)

# Calibre adds books with utc as timezone
Expand Down

0 comments on commit adf6728

Please sign in to comment.