This commit is contained in:
16
cps/web.py
16
cps/web.py
@ -1807,13 +1807,15 @@ def read_book(book_id, book_format):
|
||||
return render_title_template('readpdf.html', pdffile=book_id, title=_(u"Read a Book"))
|
||||
elif book_format.lower() == "txt":
|
||||
return render_title_template('readtxt.html', txtfile=book_id, title=_(u"Read a Book"))
|
||||
elif book_format.lower() == "cbr":
|
||||
all_name = str(book_id) + "/" + book.data[0].name + ".cbr"
|
||||
tmp_file = os.path.join(book_dir, book.data[0].name) + ".cbr"
|
||||
if not os.path.exists(all_name):
|
||||
cbr_file = os.path.join(config.config_calibre_dir, book.path, book.data[0].name) + ".cbr"
|
||||
copyfile(cbr_file, tmp_file)
|
||||
return render_title_template('readcbr.html', comicfile=all_name, title=_(u"Read a Book"))
|
||||
else:
|
||||
for format in ["cbr","cbt","cbz"]:
|
||||
if book_format.lower() == format:
|
||||
all_name = str(book_id) + "/" + book.data[0].name + "." + format
|
||||
tmp_file = os.path.join(book_dir, book.data[0].name) + "." + format
|
||||
if not os.path.exists(all_name):
|
||||
cbr_file = os.path.join(config.config_calibre_dir, book.path, book.data[0].name) + "." + format
|
||||
copyfile(cbr_file, tmp_file)
|
||||
return render_title_template('readcbr.html', comicfile=all_name, title=_(u"Read a Book"))
|
||||
|
||||
|
||||
@app.route("/download/<int:book_id>/<book_format>")
|
||||
|
Reference in New Issue
Block a user