aboutsummaryrefslogtreecommitdiff
path: root/steam/steam.go
diff options
context:
space:
mode:
Diffstat (limited to 'steam/steam.go')
-rw-r--r--steam/steam.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/steam/steam.go b/steam/steam.go
index 8c3dcbb..24e4c54 100644
--- a/steam/steam.go
+++ b/steam/steam.go
@@ -3,10 +3,10 @@
package steam
import (
+ "bufio"
+ "errors"
"fmt"
"io/ioutil"
- "errors"
- "bufio"
"os"
"path/filepath"
"strings"
@@ -20,6 +20,7 @@ type Library struct {
type Game struct {
Name string
LibraryPath string
+ Size int64
}
func ProcessMultipleLibraries(r []string) ([]*Library, error) {
@@ -44,7 +45,7 @@ func NewLibrary(path string) (*Library, error) {
return l, err
}
-func NewLibraryMust(path string) (*Library) {
+func NewLibraryMust(path string) *Library {
l, err := NewLibrary(path)
if err != nil {
panic(err)
@@ -67,11 +68,13 @@ func (s *Library) ProcessLibrary(r string) error {
s.Folder = r
for _, f := range dirs {
if f.IsDir() {
- s.Games[f.Name()] = Game{
+ g := &Game{
Name: f.Name(),
LibraryPath: r,
}
- // s.Games = append(s.Games, f.Name())
+ g.setSizeInfo()
+
+ s.Games[f.Name()] = *g
}
}