mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix pubdate incorrect when used in save to disk template in timezones ahead of GMT. Fixes #844445 (Using pubdate in save to disk file names)
This commit is contained in:
parent
26a9197cfb
commit
b80684a77b
Binary file not shown.
@ -17,7 +17,7 @@ from calibre.ebooks.metadata.opf2 import metadata_to_opf
|
||||
from calibre.constants import preferred_encoding
|
||||
from calibre.ebooks.metadata import fmt_sidx
|
||||
from calibre.ebooks.metadata import title_sort
|
||||
from calibre.utils.date import parse_date
|
||||
from calibre.utils.date import parse_date, as_local_time
|
||||
from calibre import strftime, prints, sanitize_file_name_unicode
|
||||
|
||||
plugboard_any_device_value = 'any device'
|
||||
@ -281,6 +281,11 @@ def do_save_book_to_disk(id_, mi, cover, plugboards,
|
||||
format_map, root, opts, length):
|
||||
from calibre.ebooks.metadata.meta import set_metadata
|
||||
available_formats = [x.lower().strip() for x in format_map.keys()]
|
||||
if mi.pubdate:
|
||||
mi.pubdate = as_local_time(mi.pubdate)
|
||||
if mi.timestamp:
|
||||
mi.timestamp = as_local_time(mi.timestamp)
|
||||
|
||||
if opts.formats == 'all':
|
||||
asked_formats = available_formats
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user