refactor(torrent): 优化种子文件服务和相关配置
- 修改文件重命名逻辑,移除空格和连字符处理 - 更新UI端口依赖从 sass-embedded 到 sass - 调整请求基础URL配置为局域网地址 - 重构后端运行配置以支持外部访问 - 添加种子列表路由和提取名称功能 - 移除按名称查询单个种子的路由 - 实现标准化名称提取算法 - 添加批量获取所有种子的功能
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
from flask import Blueprint, jsonify
|
||||
from flask import Blueprint, jsonify, request
|
||||
|
||||
from app.services.torrent_service import TorrentService
|
||||
|
||||
bp = Blueprint("torrent", __name__)
|
||||
|
||||
|
||||
@bp.route('/')
|
||||
def torrent_list():
|
||||
torrent_object = TorrentService(["C:\\Users\\Localhost\\Desktop\\BT"])
|
||||
return jsonify({"code": 200, "message": torrent_object.get_all()})
|
||||
|
||||
|
||||
@bp.route('/deduplication')
|
||||
def torrent_deduplication():
|
||||
torrent_object = TorrentService(["C:\\Users\\Localhost\\Desktop\\BT"])
|
||||
@@ -15,14 +21,3 @@ def torrent_deduplication():
|
||||
def torrent_statistics():
|
||||
torrent_object = TorrentService(["C:\\Users\\Localhost\\Desktop\\BT"])
|
||||
return jsonify({"code": 200, "message": torrent_object.statistics()})
|
||||
|
||||
|
||||
@bp.route("/<name>")
|
||||
def torrent_by_name(name):
|
||||
torrent_object = TorrentService(["C:\\Users\\Localhost\\Desktop\\BT"])
|
||||
return jsonify({"code": 200, "message": torrent_object.get_by_name(name)})
|
||||
|
||||
# @bp.route("/extract/name")
|
||||
# def torrent_extract_name():
|
||||
# torrent_object = TorrentService([])
|
||||
# return jsonify({"code": 200, "message": torrent_object.extract_name("AVSA-429.torrent")})
|
||||
Reference in New Issue
Block a user