mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 01:35:39 -04:00
Await recommendations fetch during title import
Recommendations were fetched fire-and-forget, causing a race condition where the title detail page would load before recommendations were populated in the database, making the section appear intermittently. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -56,7 +56,7 @@ export async function importTitle(tmdbId: number, type: "movie" | "tv") {
|
||||
}
|
||||
await refreshTvChildren(existing.id, tmdbId, show.number_of_seasons);
|
||||
refreshAvailability(existing.id).catch(() => {});
|
||||
refreshRecommendations(existing.id).catch(() => {});
|
||||
await refreshRecommendations(existing.id).catch(() => {});
|
||||
if (imageCacheEnabled()) {
|
||||
cacheImagesForTitle(existing.id).catch(() => {});
|
||||
cacheEpisodeStills(existing.id).catch(() => {});
|
||||
@@ -92,7 +92,7 @@ export async function importTitle(tmdbId: number, type: "movie" | "tv") {
|
||||
.get();
|
||||
// Fire-and-forget: fetch availability, recommendations, colors & image cache
|
||||
refreshAvailability(row.id).catch(() => {});
|
||||
refreshRecommendations(row.id).catch(() => {});
|
||||
await refreshRecommendations(row.id).catch(() => {});
|
||||
extractAndStoreColors(row.id, movie.poster_path).catch(() => {});
|
||||
if (imageCacheEnabled()) cacheImagesForTitle(row.id).catch(() => {});
|
||||
return row;
|
||||
@@ -122,7 +122,7 @@ export async function importTitle(tmdbId: number, type: "movie" | "tv") {
|
||||
await refreshTvChildren(row.id, tmdbId, show.number_of_seasons);
|
||||
// Fire-and-forget: fetch availability, recommendations, colors & image cache
|
||||
refreshAvailability(row.id).catch(() => {});
|
||||
refreshRecommendations(row.id).catch(() => {});
|
||||
await refreshRecommendations(row.id).catch(() => {});
|
||||
extractAndStoreColors(row.id, show.poster_path).catch(() => {});
|
||||
if (imageCacheEnabled()) {
|
||||
cacheImagesForTitle(row.id).catch(() => {});
|
||||
|
||||
Reference in New Issue
Block a user