This commit is contained in:
afkarxyz
2026-03-11 03:19:59 +07:00
parent d495a9851c
commit b3273b7602
42 changed files with 1807 additions and 1655 deletions
+27 -1
View File
@@ -1,7 +1,9 @@
package backend
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"regexp"
"strings"
@@ -133,10 +135,34 @@ func GetFirstArtist(artistString string) string {
}
func NormalizePath(folderPath string) string {
return strings.ReplaceAll(folderPath, "/", string(filepath.Separator))
}
func GetSeparator() string {
dir, err := GetFFmpegDir()
if err != nil {
return "; "
}
configPath := filepath.Join(dir, "config.json")
data, err := os.ReadFile(configPath)
if err != nil {
return "; "
}
var settings map[string]interface{}
if err := json.Unmarshal(data, &settings); err == nil {
if sep, ok := settings["separator"].(string); ok {
if sep == "comma" {
return ", "
}
if sep == "semicolon" {
return "; "
}
}
}
return "; "
}
func SanitizeFolderPath(folderPath string) string {
normalizedPath := strings.ReplaceAll(folderPath, "/", string(filepath.Separator))