diff --git a/backend/src/app/seeds/run.py b/backend/src/app/seeds/run.py index b2e27f1..95d031a 100644 --- a/backend/src/app/seeds/run.py +++ b/backend/src/app/seeds/run.py @@ -425,6 +425,14 @@ def _download_image( Returns the local path (relative to frontend/public). """ + # Already a local path — check the file exists, otherwise re-derive the path + if url.startswith("/"): + local = FRONTEND_PUBLIC / url.lstrip("/") + if local.exists(): + return url + # File missing — can't re-download without the original URL, keep as-is + return url + url_ext = url.rsplit(".", 1)[-1].split("?")[0].lower() if url_ext in ("png", "jpg", "jpeg", "gif", "webp", "svg"): ext = f".{url_ext}" diff --git a/docker-compose.yml b/docker-compose.yml index 8e0cb9c..c892a44 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,7 @@ services: volumes: - ./backend/src:/app/src:cached - ./backend/alembic.ini:/app/alembic.ini:cached + - ./frontend/public:/frontend/public environment: - DEBUG=true - DATABASE_URL=postgresql://postgres:postgres@db:5432/nuzlocke