From 4ed57528379c9d1ac0f5bc77b95439bbba3d4488 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sat, 21 Nov 2020 01:13:16 -0500 Subject: Initial version of a web interface --- steam/steam.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'steam') 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) { -- cgit v1.2.3