From 6fddd532c2c59d6f4cf6023691596439c44689cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20B=C3=B6hm?= Date: Thu, 14 Oct 2021 11:24:54 +0200 Subject: [PATCH] remove workshop prefix --- cmd/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/main.go b/cmd/main.go index 6fd7a3c..fa6c90c 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -4,6 +4,7 @@ import ( "time" "log" "net/http" + "strings" "git.snrd.de/Spaenny/steamServer" "git.snrd.de/Spaenny/steamServer/postgres" @@ -91,6 +92,13 @@ func updateServers(host string, store steamServer.Store) { } log.Printf("%s - %s\n", host, info.Name) + + // Some Servers use workshop maps and add a prefix, we don't need that + if strings.HasPrefix(info.Map, "workshop/") { + mapSplit := strings.Split(info.Map, "/") + info.Map = mapSplit[1] + } + server := steamServer.Server { AppID: info.ID,