diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2020-11-21 01:13:16 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2020-11-21 01:13:16 -0500 |
| commit | 4ed57528379c9d1ac0f5bc77b95439bbba3d4488 (patch) | |
| tree | df607f257e8836da69c0b9c9e8ef840c2acadff1 /steam/steam.go | |
| parent | 78712527eed66929b8147e04d18f000dcb7dfff6 (diff) | |
| download | steam-export-4ed57528379c9d1ac0f5bc77b95439bbba3d4488.tar.gz steam-export-4ed57528379c9d1ac0f5bc77b95439bbba3d4488.tar.xz | |
Initial version of a web interface
Diffstat (limited to 'steam/steam.go')
| -rw-r--r-- | steam/steam.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/steam/steam.go b/steam/steam.go index 7071a20..8c3dcbb 100644 --- a/steam/steam.go +++ b/steam/steam.go @@ -35,6 +35,23 @@ func ProcessMultipleLibraries(r []string) ([]*Library, error) { return libs, nil } +func NewLibrary(path string) (*Library, error) { + l := &Library{} + err := l.ProcessLibrary(path) + if err != nil { + return nil, err + } + return l, err +} + +func NewLibraryMust(path string) (*Library) { + l, err := NewLibrary(path) + if err != nil { + panic(err) + } + return l +} + // Populate the "Folder" and "Games" fields based on the provided directory func (s *Library) ProcessLibrary(r string) error { if !hasCommon(r) { |
