Content server: Try to detect if a book file has been edited outside of calibre and serve the updated copy

This commit is contained in:
Kovid Goyal 2019-01-30 14:59:33 +05:30
parent 6fc6abc263
commit b086766064
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -131,7 +131,7 @@ def book_manifest(ctx, rd, book_id, fmt):
if not ctx.has_id(rd, db, book_id):
raise BookNotFound(book_id, db)
with db.safe_read_lock:
fm = db.format_metadata(book_id, fmt)
fm = db.format_metadata(book_id, fmt, allow_cache=False)
if not fm:
raise HTTPNotFound('No %s format for the book (id:%s) in the library: %s' % (fmt, book_id, library_id))
size, mtime = map(int, (fm['size'], time.mktime(fm['mtime'].utctimetuple())*10))