mirror of
https://github.com/janeczku/calibre-web
synced 2024-12-25 17:40:31 +00:00
Gracefully deal with incorrect dates
This commit is contained in:
parent
2d0af0ab49
commit
adf6728f14
@ -983,9 +983,9 @@ def create_book_on_upload(modify_date, meta):
|
|||||||
# combine path and normalize path from Windows systems
|
# combine path and normalize path from Windows systems
|
||||||
path = os.path.join(author_dir, title_dir).replace('\\', '/')
|
path = os.path.join(author_dir, title_dir).replace('\\', '/')
|
||||||
|
|
||||||
if meta.pubdate != "":
|
try:
|
||||||
pubdate = datetime.strptime(meta.pubdate[:10], "%Y-%m-%d")
|
pubdate = datetime.strptime(meta.pubdate[:10], "%Y-%m-%d")
|
||||||
else:
|
except:
|
||||||
pubdate = datetime(101, 1, 1)
|
pubdate = datetime(101, 1, 1)
|
||||||
|
|
||||||
# Calibre adds books with utc as timezone
|
# Calibre adds books with utc as timezone
|
||||||
|
Loading…
Reference in New Issue
Block a user