- 移除 services/__init__.py 中的所有服务导入导出 - 将各个蓝图中的通配符导入改为具体服务模块导入 - 将 files_rename 函数重命名为 file_rename 并更新相关引用 - 更新前端 API 调用中的函数名映射 - 修复视频蓝图中的多余空行问题 - 移除种子蓝图中的未使用路由代码
23 lines
593 B
Python
23 lines
593 B
Python
from flask import Blueprint, Response, jsonify
|
|
|
|
from app.services.image_service import ImageService
|
|
from app.services.torrent_service import TorrentService
|
|
|
|
bp = Blueprint("image", __name__)
|
|
|
|
|
|
@bp.route("/export")
|
|
def image_export():
|
|
image_object = ImageService()
|
|
|
|
def generate():
|
|
yield from image_object.export()
|
|
|
|
return Response(generate(), mimetype='text/event-stream')
|
|
|
|
|
|
@bp.route("/hasTorrent")
|
|
def image_has_torrent():
|
|
torrent_obj = TorrentService(["C:\\Users\\Localhost\\Desktop\\Images"])
|
|
return jsonify({"code": 200, "message": torrent_obj.has_torrent()})
|