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

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