From 3d611a9c46884ff48e30c87ffda8f1a62affa587 Mon Sep 17 00:00:00 2001 From: AnthonyDuan Date: Sat, 22 Nov 2025 22:27:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(upload):=20=E4=BD=BF=E7=94=A8=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84=E5=92=8C=E7=88=B6=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=EF=BC=8C=E9=81=BF=E5=85=8D=20public/songs=20?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=AF=BC=E8=87=B4=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 24c7829..46825f1 100644 --- a/app.py +++ b/app.py @@ -860,9 +860,14 @@ def upload_file(): except Exception: pass - # ディレクトリを作成 - target_dir = pathlib.Path(os.getenv("TAIKO_WEB_SONGS_DIR", "public/songs")) / generated_id - target_dir.mkdir(parents=True,exist_ok=True) + base_env = os.getenv("TAIKO_WEB_SONGS_DIR") + if base_env: + base_dir = pathlib.Path(base_env) + else: + base_dir = pathlib.Path(__file__).resolve().parent / "public" / "songs" + base_dir.mkdir(parents=True, exist_ok=True) + target_dir = base_dir / generated_id + target_dir.mkdir(parents=True, exist_ok=True) # TJAを保存 (target_dir / "main.tja").write_bytes(tja_data)