Commit Graph

7209 Commits

Author SHA1 Message Date
jxxghp
1b2433f7c2 feat: implement runtime dependency checks and recovery for plugin installations 2026-05-11 08:54:34 +08:00
Aqr-K
c745616495 perf(http): 异步 HTTP 引入共享 AsyncHTTPTransport,复用 TCP/TLS 握手
AsyncRequestUtils 使用按事件循环弱引用持有的共享
AsyncHTTPTransport 作为底层连接池与 TLS 会话;每次请求创建轻量
AsyncClient 承载本次 cookie jar、timeout、follow_redirects,
用完即销毁。共享 transport 由 _NonClosingTransportProxy 包装后
注入 AsyncClient,吞掉 AsyncClient 退出时向底层 transport
传播的 __aexit__/aclose,使底层连接池跨调用持久,从而真正复用
TCP/TLS 握手。

设计要点:
- 共享 transport 桶按 (proxy, verify, max_keepalive_connections,
  max_connections, keepalive_expiry) 区分;每事件循环 32 桶 LRU
  上限,超出后异步关闭最久未用桶;关闭 task 由模块级强引用集合
  持有以兼容 Python 3.11+ 的任务 GC 行为。
- 通过 FastAPI lifespan shutdown 调用 aclose_shared_async_transports
  集中释放底层 transport,避免 ResourceWarning。
- AsyncRequestUtils.request 走三条 path:用户自管 client / 共享
  transport + per-call AsyncClient / 兜底临时 client。三条路径
  cookie 语义一致;后两条因 per-call AsyncClient 生命周期局限于
  单次调用,天然不积累 Set-Cookie,避免跨调用 jar 演化串扰。
- _make_request 对幂等方法(GET/HEAD/OPTIONS)在
  RemoteProtocolError / ReadError / WriteError 时单次重试,
  容忍 keep-alive stale 连接命中;非幂等方法不重试,但记录
  debug 日志。
- get_stream 使用 httpx.AsyncClient.stream() 标准流式 API,与
  request 共用三条 path 的 client 选择逻辑;幂等单次重试;
  yield 体异常透传给 stream 的 __aexit__。

公共 API 表面零变动。插件可通过 max_keepalive_connections /
max_connections / keepalive_expiry 三个 limits 参数为自己定制
连接池容量与握手有效期。

TMDB 真实压测(10 部美剧 × 每部 50 集,1020 请求):
61.96s → 18.15s(3.41×),单请求 p95 149.6ms → 38.1ms。
2026-05-11 08:46:40 +08:00
jxxghp
888ccfcfc2 feat: add detailed docstrings for methods in WechatClawBot and related modules 2026-05-11 08:25:25 +08:00
jxxghp
3c9228c2f8 feat: enhance iLink polling logic to support multiple payload formats and improve success determination 2026-05-11 08:02:17 +08:00
jxxghp
3776422634 fix: tighten wechatclawbot poll protocol handling 2026-05-11 07:15:04 +08:00
jxxghp
5021b2c86f feat: implement message deduplication and enhance error handling in WechatClawBot 2026-05-10 23:40:22 +08:00
jxxghp
412e10972f fix: optimize client instantiation in message sending logic 2026-05-10 23:00:47 +08:00
jxxghp
d0b1b3d7f0 feat: add QR code URL normalization for compatibility with various formats 2026-05-10 22:10:53 +08:00
jxxghp
f5fea25b41 fix: migrate wechat clawbot login cache on rename 2026-05-10 21:50:33 +08:00
jxxghp
68706d3d5b feat: add standalone wechat clawbot notifications 2026-05-10 21:47:35 +08:00
jxxghp
b768ed8fed 更新 version.py v2.11.0 2026-05-10 15:27:54 +08:00
jxxghp
c4d3d28491 fix: avoid blocking Ugreen startup on library preload
Delay Ugreen library loading until it is needed and cap poster wall pagination so a single Ugreen server cannot hang backend startup.\n\nFixes #5740
2026-05-10 12:19:36 +08:00
jxxghp
1862a7ab4b feat: expose download save paths in API
Return configured download directories as API-ready save_path values so external integrations can choose download destinations without guessing local or remote path syntax.

Fixes #5737
2026-05-10 12:02:22 +08:00
jxxghp
adb7aa6aa9 fix: prevent repeated scans after history-based exits
Only mark downloader tasks as organized after a transfer history record exists, including existing-history skips and unrecognized media failures.
2026-05-10 10:25:39 +08:00
jxxghp
79eb128196 refactor: streamline media recognition by removing MetaInfoPath usage 2026-05-10 09:26:13 +08:00
jxxghp
4d132c424a fix: avoid duplicate image fetch in transfer
Keep transfer recognition results ready for scraping without fetching images twice on the same path. Also ensure redo-by-path transfer recognition still populates image data before metadata scraping.
2026-05-10 08:22:27 +08:00
jxxghp
c52327c248 fix: only fetch images for scrape flows
Default title and path recognition to skip image fetching, while keeping scrape entrypoints and transfer-to-scrape paths populated with image data. This preserves lightweight recognition behavior without breaking metadata scraping.
2026-05-10 08:14:08 +08:00
jxxghp
1d97f2e043 fix: align media recognition fallback and shared reporting
Route title and path lookups through the fallback-aware entrypoints so auxiliary matches can reuse pre-assist keywords without forcing image fetches in lightweight flows. Also reduce noisy agent shutdown logging during cleanup.
2026-05-10 07:54:55 +08:00
Attente
ee9ea54ab7 feat(fanart): 添加异步支持并优化图片处理逻辑 2026-05-10 00:07:28 +08:00
jxxghp
4027ae2641 feat: add configurable data cleanup settings
Add a global cleanup switch, per-table retention periods, and scheduler config reload support so data cleanup can be managed and applied without restarting.
2026-05-09 21:22:02 +08:00
jxxghp
bc6c61bc45 fix(mediaserver): sync library data incrementally 2026-05-09 21:18:20 +08:00
jxxghp
cd5e693302 refactor: adjust database indexes by adding high-frequency composite indexes and removing redundant id indexes 2026-05-09 20:04:05 +08:00
jxxghp
ac11b303b3 fix: scheduled data cleanup chain 2026-05-09 18:30:55 +08:00
jxxghp
a7823fb4d1 feat: implement data cleanup chain for batch deletion of expired records 2026-05-09 14:04:10 +08:00
jxxghp
45d47d32f8 fix: optimize SSE event streaming with batched processing 2026-05-09 13:23:05 +08:00
jxxghp
893b8eba86 fix: remove unnecessary reporting for cache misses in media recognition 2026-05-09 12:01:14 +08:00
jxxghp
f9b987c3ef fix: enhance logging for shared media recognition with item details 2026-05-09 11:52:05 +08:00
jxxghp
4ef8b0ba99 fix: 修复订阅刷新共享识别缓存回填异常 2026-05-09 11:25:45 +08:00
InfinityPacer
268414fb11 test(mediaserver): cover stale tv item id fallback 2026-05-09 06:54:39 +08:00
InfinityPacer
bedab9ab92 fix(mediaserver): fallback stale tv item ids 2026-05-09 06:54:39 +08:00
jxxghp
94d7e4385e fix: update shared recognize cache flow 2026-05-08 21:21:01 +08:00
jxxghp
64b4de3900 fix: use original name for media recognize share 2026-05-08 20:36:33 +08:00
InfinityPacer
a59afe4cc9 fix(plugin): avoid clearing runtime modules after dependency install 2026-05-08 18:38:09 +08:00
InfinityPacer
7b6047accf fix(plugin): clear stale modules on reload 2026-05-08 18:37:21 +08:00
jxxghp
e217d1aa05 feat(recognize): implement media recognition sharing functionality with API integration 2026-05-08 18:08:43 +08:00
jxxghp
52e15b51db fix(cli): align frontend download with version.py
Use FRONTEND_VERSION from version.py as the default frontend release target so local setup and auto-update install the matching frontend bundle.

Closes #5693
2026-05-08 15:49:32 +08:00
jxxghp
0dab3f087d Merge remote-tracking branch 'origin/v2' into v2 2026-05-08 15:16:34 +08:00
jxxghp
e4c5a4f232 feat(provider): add kuaishou-wanqing endpoint with base URL presets and manual model input 2026-05-08 15:16:29 +08:00
InfinityPacer
a729307d30 feat(subscribe): preserve candidate match identity 2026-05-08 14:53:22 +08:00
InfinityPacer
98347669ea feat(search): mark search result context source 2026-05-08 14:53:22 +08:00
InfinityPacer
9e4020c617 feat(torrents): tag cached candidate recognition source 2026-05-08 14:53:22 +08:00
InfinityPacer
2f231fe632 feat(context): add recognition context metadata 2026-05-08 14:53:22 +08:00
jxxghp
14b366a648 refactor: adjust default and maximum limits for plugin candidates and torrent results; enhance result formatting for agents 2026-05-08 14:47:20 +08:00
jxxghp
0a0d5e6da2 docs: update AGENTS.md to improve clarity and consistency in project guidelines 2026-05-08 14:00:31 +08:00
jxxghp
3dbb68627f refactor(provider): update sort orders and add new providers 2026-05-08 13:42:31 +08:00
jxxghp
f157b61dfa docs: update AGENTS.md to clarify repository structure and guidelines 2026-05-08 13:29:18 +08:00
jxxghp
44f975baf4 docs: add comprehensive guide for MoviePilot AI Agent behavior and conventions 2026-05-08 13:17:10 +08:00
jxxghp
28ec4a6ac0 refactor(provider): update cache TTL for models.dev data to one week 2026-05-08 13:08:49 +08:00
jxxghp
1140a85402 feat(provider): implement fallback to bundled models.dev data on fetch failure 2026-05-08 13:00:27 +08:00
jxxghp
c6d95cd006 refactor(agent): consolidate provider preset resolution 2026-05-08 12:35:02 +08:00