Make pool and poolSong global variables
Build / build (push) Successful in 48s

This commit is contained in:
2026-05-26 20:54:12 +02:00
parent d152ec1f11
commit a446dad7b6
12 changed files with 253 additions and 258 deletions
+6 -6
View File
@@ -11,9 +11,9 @@ import (
func GetCharacterList() []string {
charactersPath := os.Getenv("CHARACTERS_PATH")
logging.GetLogger().Debug("Getting character list", zap.String("path", charactersPath))
if !strings.HasSuffix(charactersPath, "/") {
charactersPath += "/"
}
// Clean the path - remove trailing slashes and then add one for consistency
charactersPath = strings.TrimSuffix(charactersPath, "/")
charactersPath += "/"
files, err := os.ReadDir(charactersPath)
if err != nil {
logging.GetLogger().Fatal("Failed to read characters directory", zap.String("path", charactersPath), zap.String("error", err.Error()))
@@ -31,9 +31,9 @@ func GetCharacterList() []string {
func GetCharacter(character string) string {
charactersPath := os.Getenv("CHARACTERS_PATH")
logging.GetLogger().Debug("Getting character", zap.String("character", character), zap.String("path", charactersPath))
if !strings.HasSuffix(charactersPath, "/") {
charactersPath += "/"
}
// Clean the path - remove trailing slashes and then add one for consistency
charactersPath = strings.TrimSuffix(charactersPath, "/")
charactersPath += "/"
return charactersPath + character
}