Make sure all timestamps are using Calibre's local_tz.

This commit is contained in:
Jim Miller 2020-03-24 20:18:06 -05:00
parent e0f933c357
commit f59f1d0b37
2 changed files with 3 additions and 3 deletions

View file

@ -1250,7 +1250,7 @@ class FanFicFarePlugin(InterfaceAction):
if story.getMetadataRaw('dateCreated'):
book['timestamp'] = story.getMetadataRaw('dateCreated').replace(tzinfo=local_tz)
else:
book['timestamp'] = datetime.now() # need *something* there for calibre.
book['timestamp'] = datetime.now().replace(tzinfo=local_tz) # need *something* there for calibre.
if not merge:# skip all the collision code when d/ling for merging.
if collision in (CALIBREONLY, CALIBREONLYSAVECOL):
@ -1936,7 +1936,7 @@ class FanFicFarePlugin(InterfaceAction):
if book['calibre_id'] and lastcheckedcol_label:
#logger.debug("lastcheckedcol %s %s %s"%(book['title'],book['url'],book['timestamp']))
self.set_custom(db, book['calibre_id'], 'timestamp',
book.get('timestamp',datetime.now()), # default to now if not in book.
book.get('timestamp',datetime.now().replace(tzinfo=local_tz)), # default to now if not in book.
label=lastcheckedcol_label, commit=True)
def add_book_or_update_format(self,book,options,prefs,mi=None):

View file

@ -215,7 +215,7 @@ def do_download_for_worker(book,options,merge,notification=lambda x,y:x):
if story.getMetadataRaw('dateCreated'):
book['timestamp'] = story.getMetadataRaw('dateCreated').replace(tzinfo=local_tz)
else:
book['timestamp'] = datetime.now() # need *something* there for calibre.
book['timestamp'] = datetime.now().replace(tzinfo=local_tz) # need *something* there for calibre.
writer = writers.getWriter(options['fileform'],configuration,adapter)
outfile = book['outfile']