From 1a2f0b058cc14c8c7dc3fe82828d84f9d5f5bbe7 Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Wed, 4 Oct 2023 21:14:12 +0800 Subject: [PATCH 1/2] change: add package. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 50925212..c6ad4aae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ RUN set -ex && \ shadow \ tini \ openssl \ + busybox-suid \ tzdata && \ python3 -m pip install --no-cache-dir --upgrade pip && \ sed -i '/bcrypt/d' requirements.txt && \ From beb3e018ecaf0b5255991aefa4f6b6e30de82d84 Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Thu, 5 Oct 2023 00:51:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E6=97=A0=E6=B3=95=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main.py | 4 +--- backend/src/module/checker/checker.py | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/backend/src/main.py b/backend/src/main.py index 076ac06f..78bfcda7 100644 --- a/backend/src/main.py +++ b/backend/src/main.py @@ -58,14 +58,12 @@ else: return RedirectResponse("/docs") - - - if __name__ == "__main__": if os.getenv("IPV6"): host = "::" else: host = os.getenv("HOST", "0.0.0.0") + os.mkdir("data/posters") if not os.path.exists("data/posters") else None uvicorn.run( app, host=host, diff --git a/backend/src/module/checker/checker.py b/backend/src/module/checker/checker.py index c4c71397..430a41ee 100644 --- a/backend/src/module/checker/checker.py +++ b/backend/src/module/checker/checker.py @@ -78,13 +78,8 @@ class Checker: @staticmethod def check_img_cache() -> bool: img_path = Path("data/posters") - if img_path.exists(): + # If poster folder is not empty, return True + if list(img_path.glob("*")): return True else: - img_path.mkdir() return False - - -if __name__ == "__main__": - # print(Checker().check_downloader()) - requests.get("http://162.200.20.1", timeout=2)