diff options
Diffstat (limited to 'steam/steam.go')
| -rw-r--r-- | steam/steam.go | 8 |
1 files changed, 8 insertions, 0 deletions
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 { |
