From 0e62a3b46b25e7c101b14ed44235f3c276982fc0 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Fri, 19 Mar 2021 21:19:42 -0400 Subject: Sweeping changes to switch to bootstrap and make the UI overall a bit more user friendly --- steam/steam.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'steam') diff --git a/steam/steam.go b/steam/steam.go index 24e4c54..aca20df 100644 --- a/steam/steam.go +++ b/steam/steam.go @@ -9,6 +9,7 @@ import ( "io/ioutil" "os" "path/filepath" + "regexp" "strings" ) @@ -23,6 +24,13 @@ type Game struct { Size int64 } +var slugregexp = regexp.MustCompile(`[^-0-9A-Za-z_:.]`) + +func (g Game) Slug() string { + // return strings.ReplaceAll(g.Name, " ", "-") + return slugregexp.ReplaceAllString(g.Name, "-") +} + func ProcessMultipleLibraries(r []string) ([]*Library, error) { var libs []*Library for _, i := range r { -- cgit v1.2.3