mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update catalog timestamp/pubdate when re-generating
This commit is contained in:
parent
c32392b266
commit
3a6fb23646
@ -1,4 +1,4 @@
|
||||
import pickle, os, re, shutil, htmlentitydefs
|
||||
import os, re, shutil, htmlentitydefs
|
||||
|
||||
from xml.sax.saxutils import escape
|
||||
|
||||
|
@ -1415,9 +1415,10 @@ class LibraryDatabase2(LibraryDatabase):
|
||||
if matches:
|
||||
tag_matches = self.data.get_matches('tags', _('Catalog'))
|
||||
matches = matches.intersection(tag_matches)
|
||||
db_id = None
|
||||
db_id, existing = None, False
|
||||
if matches:
|
||||
db_id = list(matches)[0]
|
||||
existing = True
|
||||
if db_id is None:
|
||||
obj = self.conn.execute('INSERT INTO books(title, author_sort) VALUES (?, ?)',
|
||||
(title, 'calibre'))
|
||||
@ -1433,6 +1434,10 @@ class LibraryDatabase2(LibraryDatabase):
|
||||
if not hasattr(path, 'read'):
|
||||
stream.close()
|
||||
self.conn.commit()
|
||||
if existing:
|
||||
t = datetime.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