From 53cc84ec18288395e59376635586de4fd65b1dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E6=AA=8E?= Date: Tue, 7 Mar 2017 16:32:55 +0800 Subject: [PATCH] #fix 148 --- cps/web.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cps/web.py b/cps/web.py index 7008a622..a844e3bd 100755 --- a/cps/web.py +++ b/cps/web.py @@ -1236,22 +1236,22 @@ def read_book(book_id, format): zfile.close() return render_title_template('read.html', bookid=book_id, title=_(u"Read a Book")) elif format.lower() == "pdf": - all_name = str(book_id) + "/" + urllib.quote(book.data[0].name) + ".pdf" - tmp_file = os.path.join(book_dir, urllib.quote(book.data[0].name)) + ".pdf" + all_name = str(book_id) + "/" + book.data[0].name + ".pdf" + tmp_file = os.path.join(book_dir, book.data[0].name) + ".pdf" if not os.path.exists(tmp_file): pdf_file = os.path.join(config.config_calibre_dir, book.path, book.data[0].name) + ".pdf" copyfile(pdf_file, tmp_file) return render_title_template('readpdf.html', pdffile=all_name, title=_(u"Read a Book")) elif format.lower() == "txt": - all_name = str(book_id) + "/" + urllib.quote(book.data[0].name) + ".txt" - tmp_file = os.path.join(book_dir, urllib.quote(book.data[0].name)) + ".txt" + all_name = str(book_id) + "/" + book.data[0].name + ".txt" + tmp_file = os.path.join(book_dir, book.data[0].name) + ".txt" if not os.path.exists(all_name): txt_file = os.path.join(config.config_calibre_dir, book.path, book.data[0].name) + ".txt" copyfile(txt_file, tmp_file) return render_title_template('readtxt.html', txtfile=all_name, title=_(u"Read a Book")) elif format.lower() == "cbr": - all_name = str(book_id) + "/" + urllib.quote(book.data[0].name) + ".cbr" - tmp_file = os.path.join(book_dir, urllib.quote(book.data[0].name)) + ".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)