mirror of
https://github.com/Kakune55/ComiPy.git
synced 2025-09-14 11:19:34 +08:00
优化内存消耗 添加·单线程模式
This commit is contained in:
@@ -9,7 +9,7 @@ api_Img_bp = Blueprint("api_Img_bp", __name__)
|
||||
def img(bookid, index): # 图片接口
|
||||
if request.cookies.get("islogin") is None:
|
||||
return abort(403)
|
||||
if db.file.searchByid(bookid) == "":
|
||||
if len(db.file.searchByid(bookid)) == 0:
|
||||
return abort(404)
|
||||
# 设置响应类型为图片
|
||||
data, filename = file.raedZip(bookid, index)
|
||||
|
@@ -36,7 +36,7 @@ def book(bookid): # 接口
|
||||
if request.cookies.get("islogin") is None:
|
||||
return abort(403)
|
||||
data = db.file.searchByid(bookid)
|
||||
if data == "":
|
||||
if len(data) == 0:
|
||||
return abort(404)
|
||||
data[0] = list(data[0])
|
||||
data[0][2] = data[0][2][0:-4] # 把文件扩展名去掉
|
||||
@@ -55,7 +55,7 @@ def view(bookid): # 接口
|
||||
if request.cookies.get("islogin") is None:
|
||||
return abort(403)
|
||||
data = db.file.searchByid(bookid)
|
||||
if data == "":
|
||||
if len(data) == 0:
|
||||
return abort(404)
|
||||
return render_template("view.html", id=bookid, index=range(1, data[0][3]))
|
||||
|
||||
|
Reference in New Issue
Block a user