diff --git a/.gitignore b/.gitignore index 501fbd9f..56b50753 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ build/ dist/ nginx/ test.py -app/helper/sites.py app/helper/*.so app/helper/*.pyd app/helper/*.bin diff --git a/Dockerfile b/Dockerfile index c318c20f..9c575534 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,8 +88,6 @@ RUN cp -f /app/nginx.conf /etc/nginx/nginx.template.conf \ && mv /dist /public \ && curl -sL "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" | busybox unzip -d /tmp - \ && mv -f /tmp/MoviePilot-Plugins-main/plugins/* /app/app/plugins/ \ - && curl -sL "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" | busybox unzip -d /tmp - \ - && mv -f /tmp/MoviePilot-Resources-main/resources/* /app/app/helper/ \ && rm -rf /tmp/* EXPOSE 3000 VOLUME [ "/config" ] diff --git a/app/helper/sites.py b/app/helper/sites.py new file mode 100644 index 00000000..888bf465 --- /dev/null +++ b/app/helper/sites.py @@ -0,0 +1,37 @@ +from app.schemas import Plugin + + +class SitesHelper: + """ + 站点信息 + """ + + def __init__(self): + self.auth_level = 3 + self.auth_version = "1.3.2" + self.indexer_version = "1.4.7" + self.sites = [{ + id: "1", + "domain": "rarbg", + }] + + def get_indexer(self, domain: str) -> dict: + """ + 获取站点信息 + """ + for site in self.sites: + if site.get("domain") == domain: + return site + return {} + + def get_indexers(self) -> list: + """ + 获取所有站点信息 + """ + return self.sites + + def check(self, domain: str) -> tuple: + return True, "" + + def check_user(self) -> tuple: + return True, "" diff --git a/app/schemas/plugin.py b/app/schemas/plugin.py index 1277b0e4..742ff1a7 100644 --- a/app/schemas/plugin.py +++ b/app/schemas/plugin.py @@ -27,7 +27,7 @@ class Plugin(BaseModel): # 加载顺序 plugin_order: Optional[int] = 0 # 可使用的用户级别 - auth_level: Optional[int] = 3 + auth_level: Optional[int] = 0 # 是否已安装 installed: Optional[bool] = False # 运行状态