From 5ce0c35a11e2858289e3e7a2001f511d46d1540e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=81scar=20M=2E=20Lage?= Date: Mon, 14 Oct 2024 13:44:07 +0200 Subject: [PATCH] Fix: prevent api calls if we are updating --- internal/books/controller.go | 3 +++ internal/games/controller.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/internal/books/controller.go b/internal/books/controller.go index 9ca4f98..321ff2f 100644 --- a/internal/books/controller.go +++ b/internal/books/controller.go @@ -46,6 +46,9 @@ func ProcessBooks(books []Book, update bool) error { fmt.Printf(" ! Error saving updated markdown for book %s: %v\n", book.Title, err) continue } + // We want to continue the loop here, in update's cases we don't + // want to do any api calls for info nor for images + continue } // If we dont have ID, search movie by Title and get the ID diff --git a/internal/games/controller.go b/internal/games/controller.go index 081885d..2846e8f 100644 --- a/internal/games/controller.go +++ b/internal/games/controller.go @@ -46,6 +46,9 @@ func ProcessGames(games []Game, update bool) error { fmt.Printf(" ! Error saving updated markdown for game %s: %v\n", game.Title, err) continue } + // We want to continue the loop here, in update's cases we don't + // want to do any api calls for info nor for images + continue } // If we dont have ID, search movie by Title and get the ID