Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
habedi committed Jan 28, 2025
1 parent 7b46b4b commit 3cbcb95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 10 additions & 3 deletions cmd/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func generateHashFiles(dir string, algo string, recursive bool, saveToFile bool,

// Walk through the directory
go func() {
filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
if err != nil {
log.Error().Msgf("Error accessing path %q: %v", path, err)
return err
Expand All @@ -168,6 +168,9 @@ func generateHashFiles(dir string, algo string, recursive bool, saveToFile bool,
fileChan <- path
return nil
})
if err != nil {
log.Error().Msgf("Error walking the path %q: %v", dir, err)
}
close(fileChan)
}()

Expand Down Expand Up @@ -344,7 +347,9 @@ func estimateStorageSize(gameID string, language string, platformName string, ex

// Calculate the size of downloads
for _, download := range nestedData.Downloads {
if strings.ToLower(download.Language) != strings.ToLower(language) {

// Skip downloads with different language than specified
if !strings.EqualFold(download.Language, language) {
log.Info().Msgf("Skipping language %s", download.Language)
continue
}
Expand Down Expand Up @@ -395,7 +400,9 @@ func estimateStorageSize(gameID string, language string, platformName string, ex
if dlcFlag {
for _, dlc := range nestedData.DLCs {
for _, download := range dlc.ParsedDownloads {
if strings.ToLower(download.Language) != strings.ToLower(language) {

// Skip downloads with different language than specified
if !strings.EqualFold(download.Language, language) {
log.Info().Msgf("DLC %s: Skipping language %s", dlc.Title, download.Language)
continue
}
Expand Down
4 changes: 0 additions & 4 deletions db/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ func GetTokenRecord() (*Token, error) {
return nil, err
}

if &token == nil {
return nil, fmt.Errorf("no token data found. Please try logging in first")
}

return &token, nil
}

Expand Down

0 comments on commit 3cbcb95

Please sign in to comment.