fix(content): add .catch() to cover fetch promise chains in grids

Prevents unhandled promise rejections if fetch throws unexpectedly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-04 22:07:32 +00:00
co-authored by Claude Opus 4.6
parent 6e671faa3c
commit 378b60820a
5 changed files with 5 additions and 5 deletions
@@ -140,7 +140,7 @@ function fetchCoversFor(books: Book[]) {
if (book.coverUrl || fetchedCovers.has(book.id)) continue
fetchBookCover(book.title, book.author).then((url) => {
if (url) fetchedCovers.set(book.id, url)
})
}).catch(() => {})
}
}
@@ -142,7 +142,7 @@ function fetchCoversFor(films: Film[]) {
if (film.posterUrl || fetchedCovers.has(film.id)) continue
fetchFilmImage(film.title, film.year).then((result) => {
if (result.posterUrl) fetchedCovers.set(film.id, result.posterUrl)
})
}).catch(() => {})
}
}
@@ -129,7 +129,7 @@ function fetchCoversFor(podcasts: Podcast[]) {
if (podcast.coverUrl || fetchedCovers.has(podcast.id)) continue
fetchPodcastCover(podcast.title, podcast.host).then((url) => {
if (url) fetchedCovers.set(podcast.id, url)
})
}).catch(() => {})
}
}
@@ -156,7 +156,7 @@ function fetchCoversFor(songs: Song[]) {
if (song.coverUrl || fetchedCovers.has(song.id)) continue
fetchMusicCover(song.title, song.artist, song.album).then((url) => {
if (url) fetchedCovers.set(song.id, url)
})
}).catch(() => {})
}
}
@@ -159,7 +159,7 @@ function fetchCoversFor(list: TVSeries[]) {
if (s.posterUrl || fetchedCovers.has(s.id)) continue
fetchTVImage(s.title, s.year).then((result) => {
if (result.posterUrl) fetchedCovers.set(s.id, result.posterUrl)
})
}).catch(() => {})
}
}