Create folders only if there are screenshots for the game

This commit is contained in:
Felipe M 2021-01-14 20:32:36 +01:00
parent 5d814b8539
commit 3ec1042ef5
Signed by: fmartingr
GPG Key ID: 716BC147715E716F
1 changed files with 5 additions and 0 deletions

View File

@ -72,6 +72,11 @@ func processGames(games []games.Game, outputPath string, dryRun bool, downloadCo
destinationPath = filepath.Join(destinationPath, game.ID)
}
// Do not continue if there's no screenshots
if len(game.Screenshots) == 0 {
continue
}
// Check if folder exists
if _, err := os.Stat(destinationPath); os.IsNotExist(err) && !dryRun {
mkdirErr := os.MkdirAll(destinationPath, 0711)