aboutsummaryrefslogtreecommitdiff
path: root/steam/extract.go
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2023-01-20 00:35:09 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2023-01-20 00:35:09 -0500
commitf07efbb6fc7a63055a8424799ce03a5f37539873 (patch)
treeff5983b2cae4cc9b8f2f346a47cb3eb23b2f79ae /steam/extract.go
parentcbfd82db8a20be32ffa82a1afa860729f3097de6 (diff)
downloadsteam-export-f07efbb6fc7a63055a8424799ce03a5f37539873.tar.gz
steam-export-f07efbb6fc7a63055a8424799ce03a5f37539873.tar.xz
Diffstat (limited to 'steam/extract.go')
-rw-r--r--steam/extract.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/steam/extract.go b/steam/extract.go
index 45a760b..4f340fe 100644
--- a/steam/extract.go
+++ b/steam/extract.go
@@ -2,7 +2,6 @@ package steam
import (
"archive/tar"
- "errors"
"fmt"
"io"
"net/url"
@@ -20,11 +19,11 @@ const updateEveryNBytes = 10 * 1024 * 1024 // 10mb
//
// For example the following forms are accepted:
//
-// ExtractSmart("http://127.0.0.1/some-archive")
-// ExtractSmart("https://example.com/some-archive")
-// ExtractSmart("file:///some/local/file/path/to/archive.tar")
-// ExtractSmart("/direct/path/to/archive.tar")
-// ExtractSmart("C:\Users\user\Downloads\archive.tar")
+// ExtractSmart("http://127.0.0.1/some-archive")
+// ExtractSmart("https://example.com/some-archive")
+// ExtractSmart("file:///some/local/file/path/to/archive.tar")
+// ExtractSmart("/direct/path/to/archive.tar")
+// ExtractSmart("C:\Users\user\Downloads\archive.tar")
func (l *Library) ExtractSmart(uri string) (*Game, error) {
if strings.HasPrefix(uri, "http") {
_, err := url.Parse(uri)
@@ -45,7 +44,7 @@ func (l *Library) ExtractSmart(uri string) (*Game, error) {
// ExtractFile is a wrapper around Extract that handles local files. this
// spawns an "extractFile" on the library. Status will be updated there as this
-// goes along. Non fatal and fatal errors will be populated there
+// goes along. Non-fatal and fatal errors will be populated there
func (l *Library) ExtractFile(fn string) (*Game, error) {
g := &Game{}
j := newJob("extractFile", g)
@@ -125,7 +124,7 @@ func (l *Library) extractUpdate(j *Job, g *Game, rdr io.Reader) (*Game, error) {
estSize := j.GetSize()
if estSize == nil {
- j.addError(errors.New("Expected an estimated size, got nil"))
+ j.addError(E_NoEstimatedSize)
continue
}