From fb37a2677c2cf7999da9fa6237635ca299c8c7a6 Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Sun, 7 Dec 2025 15:06:07 +0100 Subject: [PATCH] restore CONTENTS_DIR --- REFACT.md | 4 ++-- domain/service.software_updater_tic80.go | 2 +- http/controller.download.go | 2 +- http/controller.play.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/REFACT.md b/REFACT.md index eda5187..b60f17e 100644 --- a/REFACT.md +++ b/REFACT.md @@ -75,7 +75,7 @@ - `parseMeta()` - Metadatok feldolgozása (de `FileRepository.ReadMetaFromFile()` segítségével) #### ✅ 3.2 Environment Variables - Centralizált konfiguráció -- `GAMES_DIR` és `CONTENTS_DIR` továbbra is `os.Getenv()`-el hívódnak +- `GAMES_DIR` és `GAMES_DIR` továbbra is `os.Getenv()`-el hívódnak - MEGLÉPÉS: Az env vars a Domain inicializációban továbbra is szétszórva vannak - TODO: Config struct még nem készült (de nem kritikus) @@ -100,7 +100,7 @@ ``` #### ✅ 3.6 Erőforrás nevek megtisztítása -- `GAMES_DIR` → `CONTENTS_DIR` (nem "game" szó) +- `GAMES_DIR` → `GAMES_DIR` (nem "game" szó) - Összes referencia frissítve --- diff --git a/domain/service.software_updater_tic80.go b/domain/service.software_updater_tic80.go index 24f6402..0717f7e 100644 --- a/domain/service.software_updater_tic80.go +++ b/domain/service.software_updater_tic80.go @@ -29,7 +29,7 @@ func NewSoftwareUpdaterTIC80Service( func (s *SoftwareUpdaterTIC80Service) Update(name string) error { fmt.Printf("TIC80 Updater: Starting update for name: %s\n", name) - contentsPath, _ := os.LookupEnv("CONTENTS_DIR") + contentsPath, _ := os.LookupEnv("GAMES_DIR") // Case 1: HTML content (name.html.zip) if err := s.handleHTMLContent(name, contentsPath); err == nil { diff --git a/http/controller.download.go b/http/controller.download.go index bb943e5..d9fd5a4 100644 --- a/http/controller.download.go +++ b/http/controller.download.go @@ -33,7 +33,7 @@ func (c *DownloadController) serve(w http.ResponseWriter, r *http.Request, relea return } - absContentsDir, err := filepath.Abs(os.Getenv("CONTENTS_DIR")) + absContentsDir, err := filepath.Abs(os.Getenv("GAMES_DIR")) if err != nil { http.Error(w, "Invalid contents directory path", http.StatusInternalServerError) return diff --git a/http/controller.play.go b/http/controller.play.go index ad19e6c..6ed5eb7 100644 --- a/http/controller.play.go +++ b/http/controller.play.go @@ -40,7 +40,7 @@ func (c *PlayController) Play(w http.ResponseWriter, r *http.Request) { } func (c *PlayController) ServeContent(w http.ResponseWriter, r *http.Request) { - contentsPath := os.Getenv("CONTENTS_DIR") + contentsPath := os.Getenv("GAMES_DIR") name := chi.URLParam(r, "name") if name == "" { http.Error(w, "Name not provided", http.StatusBadRequest)