Fix: priting errors

This commit is contained in:
Óscar M. Lage 2024-10-11 21:24:46 +02:00
parent 6f7a5c9b74
commit 78f919158e
5 changed files with 12 additions and 12 deletions

View File

@ -35,7 +35,7 @@ func ProcessBooks(books []Book) error {
if book.ID == "" {
err := SearchBookByTitle(book.Title, &book)
if err != nil {
fmt.Printf("Error searching book by title %s: %s\n", book.Title, err)
fmt.Printf(" ! Error searching book by title %s: %s\n", book.Title, err)
continue
}
}
@ -46,7 +46,7 @@ func ProcessBooks(books []Book) error {
if imageURL != "" {
err := DownloadImage(imageURL, book.Slug)
if err != nil {
fmt.Printf("Error downloading %s: %s\n", imageURL, err)
fmt.Printf(" ! Error downloading %s: %s\n", imageURL, err)
}
}
book.Image = fmt.Sprintf("%s.jpg", book.Slug)

View File

@ -35,7 +35,7 @@ func ProcessGames(games []Game) error {
if game.ID == 0 {
err := SearchGameByTitle(game.Title, &game)
if err != nil {
fmt.Printf("Error searching game by title %s: %s\n", game.Title, err)
fmt.Printf(" ! Error searching game by title %s: %s\n", game.Title, err)
continue
}
}
@ -46,7 +46,7 @@ func ProcessGames(games []Game) error {
suffix := ""
err := DownloadImage(game.Image, game.Slug, suffix)
if err != nil {
fmt.Printf("Error downloading %s: %s\n", game.Image, err)
fmt.Printf(" ! Error downloading %s: %s\n", game.Image, err)
}
game.Image = fmt.Sprintf("%s.jpg", game.Slug)
}

View File

@ -37,7 +37,7 @@ func ProcessMovies(movies []Movie) error {
if movie.IDs.Trakt == 0 {
err := SearchMovieByTitle(movie.Title, &movie)
if err != nil {
fmt.Printf("Error searching movie by title %s: %s\n", movie.Title, err)
fmt.Printf(" ! Error searching movie by title %s: %s\n", movie.Title, err)
continue
}
}
@ -45,7 +45,7 @@ func ProcessMovies(movies []Movie) error {
// Now we need to get the images from fanart
posterURL, backgroundURL, logoURL, err := FetchImagesFromFanart(movie.IDs.TMDB)
if err != nil {
fmt.Printf("Error fetching images from Fanart.tv for %s: %s\n", movie.Title, err)
fmt.Printf(" ! Error fetching images from Fanart.tv for %s: %s\n", movie.Title, err)
continue
}
@ -75,7 +75,7 @@ func ProcessMovies(movies []Movie) error {
if image.URL != "" {
err := DownloadImage(image.URL, movie.IDs.Slug, image.ImageType)
if err != nil {
fmt.Printf("Error downloading %s for %s: %s\n", image.ImageType, movie.Title, err)
fmt.Printf(" ! Error downloading %s for %s: %s\n", image.ImageType, movie.Title, err)
} else {
image.SetField(fmt.Sprintf("%s-%s.jpg", movie.IDs.Slug, image.ImageType))
}

View File

@ -35,7 +35,7 @@ func ProcessAlbum(albumList []Album) error {
if album.ID == "" {
err := SearchAlbumByTitle(album.Title, &album)
if err != nil {
fmt.Printf("Error searching album by title %s: %s\n", album.Title, err)
fmt.Printf(" ! Error searching album by title %s: %s\n", album.Title, err)
continue
}
}
@ -45,7 +45,7 @@ func ProcessAlbum(albumList []Album) error {
if album.Image != "" {
err := DownloadImage(album.Image, album.Slug)
if err != nil {
fmt.Printf("Error downloading %s: %s\n", album.Image, err)
fmt.Printf(" ! Error downloading %s: %s\n", album.Image, err)
}
}
album.Image = fmt.Sprintf("%s.jpg", album.Slug)

View File

@ -37,7 +37,7 @@ func ProcessSeries(series []Serie) error {
if serie.IDs.Trakt == 0 {
err := SearchSerieByTitle(serie.Title, &serie)
if err != nil {
fmt.Printf("Error searching serie by title %s: %s\n", serie.Title, err)
fmt.Printf(" ! Error searching serie by title %s: %s\n", serie.Title, err)
continue
}
}
@ -45,7 +45,7 @@ func ProcessSeries(series []Serie) error {
// Now we need to get the images from fanart
posterURL, backgroundURL, logoURL, err := FetchImagesFromFanart(serie.IDs.TVDB)
if err != nil {
fmt.Printf("Error fetching images from Fanart.tv for %s: %s\n", serie.Title, err)
fmt.Printf(" ! Error fetching images from Fanart.tv for %s: %s\n", serie.Title, err)
continue
}
@ -75,7 +75,7 @@ func ProcessSeries(series []Serie) error {
if image.URL != "" {
err := DownloadImage(image.URL, serie.IDs.Slug, image.ImageType)
if err != nil {
fmt.Printf("Error downloading %s for %s: %s\n", image.ImageType, serie.Title, err)
fmt.Printf(" ! Error downloading %s for %s: %s\n", image.ImageType, serie.Title, err)
} else {
image.SetField(fmt.Sprintf("%s-%s.jpg", serie.IDs.Slug, image.ImageType))
}