From d7ee3e82c80f5ebc9270059cbb45b07bda4e4f68 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Sun, 28 Sep 2025 23:12:35 +0200 Subject: [PATCH] Don't format URL in the name Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- back/server/utils.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/back/server/utils.go b/back/server/utils.go index 13678dc..7797059 100644 --- a/back/server/utils.go +++ b/back/server/utils.go @@ -105,14 +105,20 @@ func FormatParquetName(path string) string { } } - sourceName = strings.ReplaceAll(sourceName, "_", " ") - sourceWords := strings.Fields(sourceName) - for i, word := range sourceWords { - if len(word) > 0 { - sourceWords[i] = strings.ToUpper(string(word[0])) + word[1:] + formattedSourceName := "" + if strings.Contains(sourceName, ".") { // If it's an URL + sourceName = strings.ReplaceAll(sourceName, "_", "-") + formattedSourceName = sourceName + } else { // Else + sourceName = strings.ReplaceAll(sourceName, "_", " ") + sourceWords := strings.Fields(sourceName) + for i, word := range sourceWords { + if len(word) > 0 { + sourceWords[i] = strings.ToUpper(string(word[0])) + word[1:] + } } + formattedSourceName = strings.Join(sourceWords, " ") } - formattedSourceName := strings.Join(sourceWords, " ") if len(blocks) > 0 { return fmt.Sprintf("%s (%s)", formattedSourceName, strings.Join(blocks, ", "))