mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix a bug that caused the same news download sent via a USB connection to the device on two different days resulting in a duplicate on the device
This commit is contained in:
parent
928ba3bc1b
commit
5e82027ef7
@ -1077,8 +1077,13 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
settings = self.settings()
|
settings = self.settings()
|
||||||
template = self.save_template()
|
template = self.save_template()
|
||||||
if mdata.tags and _('News') in mdata.tags:
|
if mdata.tags and _('News') in mdata.tags:
|
||||||
today = time.localtime()
|
try:
|
||||||
template = "{title}_%d-%d-%d" % (today[0], today[1], today[2])
|
p = mdata.pubdate
|
||||||
|
date = (p.year, p.month, p.day)
|
||||||
|
except:
|
||||||
|
today = time.localtime()
|
||||||
|
date = (today[0], today[1], today[2])
|
||||||
|
template = "{title}_%d-%d-%d" % date
|
||||||
use_subdirs = self.SUPPORTS_SUB_DIRS and settings.use_subdirs
|
use_subdirs = self.SUPPORTS_SUB_DIRS and settings.use_subdirs
|
||||||
|
|
||||||
fname = sanitize(fname)
|
fname = sanitize(fname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user