diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2021-03-19 21:19:42 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2021-03-19 21:19:42 -0400 |
| commit | 0e62a3b46b25e7c101b14ed44235f3c276982fc0 (patch) | |
| tree | fe37304d6e36dcb5ebe1e921a20795c38d476165 /steam | |
| parent | 1e435e039d95ad8834dc3f3cd244ff87d5624c73 (diff) | |
| download | steam-export-0e62a3b46b25e7c101b14ed44235f3c276982fc0.tar.gz steam-export-0e62a3b46b25e7c101b14ed44235f3c276982fc0.tar.xz | |
Sweeping changes to switch to bootstrap and make the UI overall a bit more user friendly
Diffstat (limited to 'steam')
| -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 { |
