mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix catalog date issues
This commit is contained in:
parent
d45da57047
commit
40e3b163fa
@ -139,12 +139,11 @@ class FileTypePlugin(Plugin):
|
||||
#: to the database
|
||||
on_import = False
|
||||
|
||||
#: If True, this plugin is run whenever an any2* tool
|
||||
#: is used, on the file passed to the any2* tool.
|
||||
#: If True, this plugin is run just before a conversion
|
||||
on_preprocess = False
|
||||
|
||||
#: If True, this plugin is run after an any2* tool is
|
||||
#: used, on the final file produced by the tool.
|
||||
#: If True, this plugin is run after conversion
|
||||
#: on the final file produced by the conversion output plugin.
|
||||
on_postprocess = False
|
||||
|
||||
type = _('File type')
|
||||
|
@ -1475,18 +1475,21 @@ class LibraryDatabase2(LibraryDatabase):
|
||||
self.data.books_added([db_id], self)
|
||||
self.set_path(db_id, index_is_id=True)
|
||||
self.conn.commit()
|
||||
try:
|
||||
mi = get_metadata(stream,
|
||||
os.path.splitext(path)[1][1:].lower())
|
||||
except:
|
||||
mi = MetaInformation(title, ['calibre'])
|
||||
mi.tags = [_('Catalog')]
|
||||
self.set_metadata(db_id, mi)
|
||||
|
||||
mi.title, mi.authors = title, ['calibre']
|
||||
mi.tags = [_('Catalog')]
|
||||
mi.pubdate = mi.timestamp = nowf()
|
||||
self.set_metadata(db_id, mi)
|
||||
|
||||
self.add_format(db_id, format, stream, index_is_id=True)
|
||||
if not hasattr(path, 'read'):
|
||||
stream.close()
|
||||
self.conn.commit()
|
||||
if existing:
|
||||
t = utcnow()
|
||||
self.set_timestamp(db_id, t, notify=False)
|
||||
self.set_pubdate(db_id, t, notify=False)
|
||||
self.data.refresh_ids(self, [db_id]) # Needed to update format list and size
|
||||
return db_id
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user