From b46eefa34a7233335a3e9aec6ae44a70769f5c66 Mon Sep 17 00:00:00 2001 From: Trit0 Date: Sun, 29 Jun 2025 18:35:33 -0400 Subject: [PATCH] images perchance? --- lib/provider/provider.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/provider/provider.go b/lib/provider/provider.go index bebac4d..9e09110 100644 --- a/lib/provider/provider.go +++ b/lib/provider/provider.go @@ -73,6 +73,7 @@ func GetOrSetEnvKey(key string, defaultValue string) string { func extractZipToSiblingFolder(zipPath string) error { // Determine destination folder name (same name as zip file, without .zip) zipBase := strings.TrimSuffix(filepath.Base(zipPath), ".conj") + zipBase = strings.TrimSuffix(filepath.Base(zipBase), ".zip") destDir := filepath.Join(filepath.Dir(zipPath), zipBase) // Delete destination folder if it exists @@ -186,14 +187,14 @@ func GetConjureGameInfo() []models.Game { newGames := readFolder(e, gamePath) games = append(newGames, games...) } else if filepath.Ext(e.Name()) == ".conj" { - zipPath := filepath.Join(gamePath, e.Name()) - r, err := zip.OpenReader(zipPath) + conjPath := filepath.Join(gamePath, e.Name()) + r, err := zip.OpenReader(conjPath) if err != nil { log.Fatal(err) } defer r.Close() - fmt.Println("Contents of", zipPath) + fmt.Println("Contents of", conjPath) for _, f := range r.File { printIndentedPath(f.Name) if f.Name == "metadata.txt" { @@ -206,6 +207,9 @@ func GetConjureGameInfo() []models.Game { fmt.Println("Contents of metadata.txt:") metadata, err := io.ReadAll(rc) game := parseGameInfo(metadata) + conjBase := strings.TrimSuffix(filepath.Base(conjPath), ".conj") + game.ThumbnailPath = filepath.Join(conjBase, game.ThumbnailPath) + game.ImagePath = filepath.Join(conjBase, game.ImagePath) games = append(games, game) if err != nil { log.Fatal(err)