Merge pull request #7447 from warzook/fix/issue-7446

This commit is contained in:
jxxghp
2026-11-18 13:28:54 +08:00
committed by GitHub
4 changed files with 21 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ from urllib.parse import urlparse
from app.adapters.network.http import AsyncRequestUtils, RequestUtils
from app.application.configuration import get_configured_system_config
from app.domain import site as site_rules
from app.foundation import text as text_tools
from app.runtime.log import logger
from app.runtime.settings import get_runtime_setting
from app.schemas.types import MediaType
@@ -196,6 +197,7 @@ class HddolbySpider:
'freedate': result.get('promotion_until'),
'page_url': self._pageurl % result.get('id') if self._pageurl else '',
'labels': torrentLabels,
'hit_and_run': text_tools.parse_bool(result.get('hr')),
'category': category
}
torrents.append(torrent)

View File

@@ -851,7 +851,7 @@ flowchart LR
| 指标 | 当前值 |
|---|---:|
| Python 模块 | 1178 |
| 内部导入边 | 10,333 |
| 内部导入边 | 10,335 |
| 非平凡 SCC | 1(29 个模块的 TMDB vendor 精确 containment) |
| Application / Chain 具体 Adapter 直连 | 0 / 0 |
| Direct egress | 51(精确 policy 准入,Application / Chain 均为 0) |

View File

@@ -977,8 +977,8 @@
"runtime_only": true
}
},
"edge_count": 10333,
"edge_sha256": "2fcd2139eeb96786c233172e5529094016404aaf87bd15711174c65dea2eb066",
"edge_count": 10335,
"edge_sha256": "5718f6bd1f1f823a40222a7695ea32056aea169e5082271da7ccc39d4d3cf198",
"edges": [
"app -> app.foundation",
"app -> app.foundation.environment",
@@ -8369,6 +8369,8 @@
"app.modules.indexer.spider.hddolby -> app.application.configuration",
"app.modules.indexer.spider.hddolby -> app.domain",
"app.modules.indexer.spider.hddolby -> app.domain.site",
"app.modules.indexer.spider.hddolby -> app.foundation",
"app.modules.indexer.spider.hddolby -> app.foundation.text",
"app.modules.indexer.spider.hddolby -> app.runtime",
"app.modules.indexer.spider.hddolby -> app.runtime.log",
"app.modules.indexer.spider.hddolby -> app.runtime.settings",

View File

@@ -76,6 +76,20 @@ def test_parse_result_marks_music_torrents(hddolby_spider):
]
def test_parse_result_maps_hit_and_run(hddolby_spider):
"""
hr 标记应映射为 hit_and_run,兼容数值、字符串和缺失字段。
"""
results = hddolby_spider._HddolbySpider__parse_result([
{"id": 1, "name": "The Odyssey 2026 2160p", "category": 401, "size": 1024, "hr": 1},
{"id": 2, "name": "Example Movie 1080p", "category": 401, "size": 1024, "hr": 0},
{"id": 3, "name": "Example TV 1080p", "category": 402, "size": 1024, "hr": "1"},
{"id": 4, "name": "Example TV 2160p", "category": 402, "size": 1024},
])
assert [torrent["hit_and_run"] for torrent in results] == [True, False, True, False]
@pytest.mark.parametrize("asynchronous", [False, True])
@pytest.mark.parametrize(
("domain", "api_url", "expected_url"),