diff --git a/app/core/config.py b/app/core/config.py index c4e99b96..989b770e 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -212,6 +212,10 @@ class Settings(BaseSettings): OVERWRITE_MODE: str = "size" # 大内存模式 BIG_MEMORY_MODE: bool = False + # 插件市场地址 + PLUGIN_MARKET: str = "https://movie-pilot.org/pluginmarket" + # 资源包更新地址 + RESOURCE_HOST: str = "https://movie-pilot.org/resources" @property def INNER_CONFIG_PATH(self): diff --git a/app/helper/plugin.py b/app/helper/plugin.py new file mode 100644 index 00000000..ded20843 --- /dev/null +++ b/app/helper/plugin.py @@ -0,0 +1,31 @@ +from pathlib import Path +from typing import Dict + +from cachetools import TTLCache, cached + +from app.utils.singleton import Singleton + + +class PluginHelper(metaclass=Singleton): + """ + 插件市场管理,下载安装插件到本地 + """ + + @cached(cache=TTLCache(maxsize=1, ttl=1800)) + def get_plugins(self) -> Dict[str, dict]: + """ + 获取所有插件列表 + """ + pass + + def download(self, name: str, dest: Path) -> bool: + """ + 下载插件到本地 + """ + pass + + def install(self, name: str) -> bool: + """ + 安装插件 + """ + pass diff --git a/app/helper/resource.py b/app/helper/resource.py new file mode 100644 index 00000000..477254f0 --- /dev/null +++ b/app/helper/resource.py @@ -0,0 +1,42 @@ +from typing import Tuple, Dict + +from cachetools import TTLCache, cached + +from app.utils.singleton import Singleton + + +class ResourceHelper(metaclass=Singleton): + """ + 资源包管理,下载更新资源包 + """ + + @cached(cache=TTLCache(maxsize=1, ttl=1800)) + def get_versions(self) -> Dict[str, dict]: + """ + 获取资源包版本信息 + """ + pass + + def check_auth_update(self) -> Tuple[bool, str]: + """ + 检查认证资源是否有新版本 + """ + pass + + def check_sites_update(self) -> Tuple[bool, str]: + """ + 检查站点资源是否有新版本 + """ + pass + + def update_auth(self) -> bool: + """ + 更新认证资源 + """ + pass + + def update_sites(self) -> bool: + """ + 更新站点资源 + """ + pass