mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix bug causing the calibre server to open files in read-write mode instead of read-only
This commit is contained in:
parent
292d50d3f5
commit
901af7414a
@ -309,7 +309,7 @@ class LibraryServer(object):
|
|||||||
def get_format(self, id, format):
|
def get_format(self, id, format):
|
||||||
format = format.upper()
|
format = format.upper()
|
||||||
fmt = self.db.format(id, format, index_is_id=True, as_file=True,
|
fmt = self.db.format(id, format, index_is_id=True, as_file=True,
|
||||||
mode='r+b')
|
mode='rb')
|
||||||
if fmt is None:
|
if fmt is None:
|
||||||
raise cherrypy.HTTPError(404, 'book: %d does not have format: %s'%(id, format))
|
raise cherrypy.HTTPError(404, 'book: %d does not have format: %s'%(id, format))
|
||||||
if format == 'EPUB':
|
if format == 'EPUB':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user