mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 16:13:38 +02:00
...
This commit is contained in:
parent
7e0ac417d7
commit
8c04dc14bd
1 changed files with 7 additions and 2 deletions
|
|
@ -6,6 +6,7 @@
|
|||
import os
|
||||
import time
|
||||
|
||||
from calibre.utils.date import parse_date
|
||||
from calibre.devices.usbms.books import Book as Book_
|
||||
|
||||
class Book(Book_):
|
||||
|
|
@ -32,9 +33,13 @@ def __init__(self, prefix, lpath, title, authors, mime, date, ContentType,
|
|||
self.datetime = time.strptime(date, "%Y-%m-%dT%H:%M:%S.%f")
|
||||
except:
|
||||
try:
|
||||
self.datetime = time.gmtime(os.path.getctime(self.path))
|
||||
self.datetime = parse_date(date,
|
||||
assume_utc=True).timetuple()
|
||||
except:
|
||||
self.datetime = time.gmtime()
|
||||
try:
|
||||
self.datetime = time.gmtime(os.path.getctime(self.path))
|
||||
except:
|
||||
self.datetime = time.gmtime()
|
||||
else:
|
||||
try:
|
||||
self.datetime = time.gmtime(os.path.getctime(self.path))
|
||||
|
|
|
|||
Loading…
Reference in a new issue