Aqr-K 3d594ecee3 refactor(plugin): 插件配置改走独立通道,SystemConfig 不再按键值分支
插件配置此前借用 systemconfig 的 plugin.<实例ID> 单键,为了换表又在
SystemConfigOper 的 set/delete/load_snapshot 里按该前缀开分支。这是反向依赖:
一个对所有键一视同仁的通用键值存储被迫知道「插件」这个概念,读写路径依键值而
异,「这个键落在哪张表」只有读代码才说得清;规范方法按值加特例,也让此后任何新
键都要先确认自己会不会被拦截。

本次把插件配置整条链拆出,形状与本分支日志等级那条链一致:

- SystemConfigOper 整体回退到官方实现,与 f70d7c141 逐字节相同,对所有键一视同仁。
- 配置端口改按实例 ID 寻址:PluginStorage 新增 read_config / write_config /
  async_write_config / delete_config,PluginConfigStore 去掉 key_prefix 与 _key,
  不再有任何字符串键经过;plugin_exists 存在性规则、空键过滤与 force 语义不变。
- PluginInstanceOper 补齐读取与异步写入原语 get_config_data /
  async_save_config_data,同步与异步共用同一份落库决策,避免两条路径对「值未变化
  不写」和「建行用哪个源插件」各自分叉。
- _PluginBase 的 get_config / update_config 直连 PluginInstanceOper,方法名、签名、
  返回与 docstring 不变;self.systemconfig 保留,插件读 SystemConfigKey 枚举值仍
  然合法,插件公开面没有扩大。

插件直接用 SystemConfig 存取自身配置不予支持。它本就不是封装过的插件配置通道,
为它设计兼容或加守卫拦截,等于再把「插件」塞回通用存储里——那正是本次要拆掉的东
西。拆开后 plugin.<ID> 只是一个与插件无关的普通 systemconfig 键:迁移已经把旧的
plugin.* 行搬进插件实例表,读它拿到 None,写它会新增一条谁也不读的 systemconfig
记录,插件配置通道既不读也不写它,两边不会再有任何交叉。

代价是读取从内存快照变成一次按实例 ID 的主键查询。调用点都不在热路径上:宿主侧
只有插件启动/重载、配置表单接口与分身创建三处,插件侧 get_config() 惯例在
init_plugin 里取一次。写入侧没有变化,本来就是一次事务。

回归防线:新增用例断言 SystemConfigOper 对 plugin. 前缀没有任何特殊行为——写进去
就是一行普通 systemconfig 记录,读出来就是刚写的值,不会被路由到插件实例表。

兼容层零改动,三个 alembic 迁移一行未改。
2026-09-13 01:41:57 -04:00
2026-08-14 15:45:38 +08:00
…
…
…
2026-08-30 10:13:10 +08:00

MoviePilot

简体中文 | English

GitHub Repo stars GitHub forks GitHub contributors GitHub repo size GitHub issues Docker Pulls Docker Pulls V2 Docker Pulls V3 Platform

Redesigned from parts of NAStool, with a stronger focus on core automation scenarios while reducing issues and making the project easier to extend and maintain.

For learning and personal communication only. Please do not promote this project on platforms in mainland China.

Release channel: https://t.me/moviepilot_channel

Key Features

  • Focuses on the core media automation flow: subscriptions, search, downloads, file organization, scraping, media server refresh, and notifications.
  • Uses a separated backend/frontend architecture: FastAPI for the backend and Vue 3 for the frontend.
  • Connects download clients, media servers, metadata providers, message channels, plugins, workflows, and AI Agent capabilities.
  • For feature details, screenshots, and product entry points, see https://movie-pilot.org

Installation and Usage

Docker is the recommended deployment model. V3 uses the dedicated jxxghp/moviepilot-v3 image; V2 and legacy images keep their existing names. Compose examples, environment variables, volume mappings, and upgrade notes are maintained in the official wiki:

MoviePilot can also be installed and managed from source with the local CLI:

curl -fsSL https://raw.githubusercontent.com/jxxghp/MoviePilot/v3/scripts/bootstrap-local.sh | bash

After installation, use the moviepilot command for initialization, service management, updates, and configuration. See docs/cli.md for the full command reference.

Agent

  1. MoviePilot includes a built-in AI Agent. After model configuration, it can call system tools through natural language to help with search, subscriptions, downloads, organization, diagnostics, and other management tasks.

  2. Other agents can import the repository skills/ directory to gain MoviePilot operation capabilities. Environments that support the skills CLI can use:

    npx skills add https://github.com/jxxghp/MoviePilot
    

    Built-in skills live in skills/. For custom skill authoring, see skills/create-moviepilot-skill/SKILL.md.

  3. Other MCP clients can call MoviePilot tools through /api/v1/mcp. Authentication, client configuration, and tool APIs are documented in docs/mcp-api.md.

Development

Before contributing, read the repository rules and local environment guide, keep changes focused, and validate them before opening a PR. Useful entry points:

Disclaimer

  • This software is for learning and personal communication only. It must not be used for commercial purposes or illegal activities. The software does not know how users choose to use it, and all responsibility rests with the user.
  • The source code is open source and derived from other open-source code. If someone removes the relevant restrictions and redistributes or publishes modified versions that lead to liability events, the publisher of those modifications bears full responsibility. Public releases that bypass or alter the user authentication mechanism are not recommended.
  • This project does not accept donations and has not published any donation page anywhere. The software itself is free of charge and does not provide paid services. Please verify information carefully to avoid being misled.

Contributors

Description
No description provided
Readme GPL-3.0 138 MiB
Languages
Python 99.4%
Shell 0.4%
Dockerfile 0.2%