feat:服务器地址变量化

This commit is contained in:
jxxghp 2024-05-21 17:31:12 +08:00
parent 7c7bc0b504
commit 5be2bf0633
4 changed files with 9 additions and 8 deletions

View File

@ -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` 或其它中转代理服务地址,能连通即可

View File

@ -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",

View File

@ -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()

View File

@ -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()