From 5be2bf0633d8f3ad93e89a3523ce4d8a514159ef Mon Sep 17 00:00:00 2001 From: jxxghp Date: Tue, 21 May 2024 17:31:12 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E5=8F=98=E9=87=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - app/core/config.py | 2 ++ app/helper/plugin.py | 6 +++--- app/helper/subscribe.py | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ab1cbc77..6ae32ab6 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,6 @@ MoviePilot需要配套下载器和媒体服务器配合使用。 - **META_CACHE_EXPIRE:** 元数据识别缓存过期时间(小时),数字型,不配置或者配置为0时使用系统默认(大内存模式为7天,否则为3天),调大该值可减少themoviedb的访问次数 - **GITHUB_TOKEN:** Github token,提高自动更新、插件安装等请求Github Api的限流阈值,格式:ghp_**** - **DEV:** 开发者模式,`true`/`false`,默认`false`,仅用于本地开发使用,开启后会暂停所有定时任务,且插件代码文件的修改无需重启会自动重载生效 -- **PLUGIN_AUTO_RELOAD:** 插件热加载,`true`/`false`,默认`false`,开启后插件代码文件的修改无需重启会自动重载生效 - **AUTO_UPDATE_RESOURCE**:启动时自动检测和更新资源包(站点索引及认证等),`true`/`false`,默认`true`,需要能正常连接Github,仅支持Docker镜像 --- - **TMDB_API_DOMAIN:** TMDB API地址,默认`api.themoviedb.org`,也可配置为`api.tmdb.org`、`tmdb.movie-pilot.org` 或其它中转代理服务地址,能连通即可 diff --git a/app/core/config.py b/app/core/config.py index 114bee68..1de8d01c 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -252,6 +252,8 @@ class Settings(BaseSettings): SUBSCRIBE_STATISTIC_SHARE: bool = True # 插件安装数据共享 PLUGIN_STATISTIC_SHARE: bool = True + # 服务器地址,对应 https://github.com/jxxghp/MoviePilot-Server 项目 + MP_SERVER_HOST: str = "https://movie-pilot.org" @validator("SUBSCRIBE_RSS_INTERVAL", "COOKIECLOUD_INTERVAL", diff --git a/app/helper/plugin.py b/app/helper/plugin.py index 23aaae53..544bf7f6 100644 --- a/app/helper/plugin.py +++ b/app/helper/plugin.py @@ -22,11 +22,11 @@ class PluginHelper(metaclass=Singleton): _base_url = "https://raw.githubusercontent.com/%s/%s/main/" - _install_reg = "https://movie-pilot.org/plugin/install/%s" + _install_reg = f"{settings.MP_SERVER_HOST}/plugin/install/%s" - _install_report = "https://movie-pilot.org/plugin/install" + _install_report = f"{settings.MP_SERVER_HOST}/plugin/install" - _install_statistic = "https://movie-pilot.org/plugin/statistic" + _install_statistic = f"{settings.MP_SERVER_HOST}/plugin/statistic" def __init__(self): self.systemconfig = SystemConfigOper() diff --git a/app/helper/subscribe.py b/app/helper/subscribe.py index 87995221..be0aae61 100644 --- a/app/helper/subscribe.py +++ b/app/helper/subscribe.py @@ -16,13 +16,13 @@ class SubscribeHelper(metaclass=Singleton): 订阅数据统计 """ - _sub_reg = "https://movie-pilot.org/subscribe/add" + _sub_reg = f"{settings.MP_SERVER_HOST}/subscribe/add" - _sub_done = "https://movie-pilot.org/subscribe/done" + _sub_done = f"{settings.MP_SERVER_HOST}/subscribe/done" - _sub_report = "https://movie-pilot.org/subscribe/report" + _sub_report = f"{settings.MP_SERVER_HOST}/subscribe/report" - _sub_statistic = "https://movie-pilot.org/subscribe/statistic" + _sub_statistic = f"{settings.MP_SERVER_HOST}/subscribe/statistic" def __init__(self): self.systemconfig = SystemConfigOper()