Skip to content

Commit

Permalink
fix(discover): display recent requests even if there is an error with…
Browse files Browse the repository at this point in the history
… *arr (Fallenbagel#1141)

If Jellyseerr can't connect to Radarr/Sonarr, the "Recent Requests" slider will not load because of
the error throwed when trying to get the Quality Profile. This PR catch this error so the recent
requests are well displayed.
  • Loading branch information
gauthier-th authored and thibodelanghe committed Dec 18, 2024
1 parent c4591fb commit 04813a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/routes/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ requestRoutes.get<Record<string, unknown>, RequestResultsResponse>(

return {
id: sonarrSetting.id,
profiles: await sonarr.getProfiles(),
profiles: await sonarr.getProfiles().catch(() => undefined),
};
})
);
Expand All @@ -174,7 +174,7 @@ requestRoutes.get<Record<string, unknown>, RequestResultsResponse>(

return {
id: radarrSetting.id,
profiles: await radarr.getProfiles(),
profiles: await radarr.getProfiles().catch(() => undefined),
};
})
);
Expand All @@ -185,7 +185,7 @@ requestRoutes.get<Record<string, unknown>, RequestResultsResponse>(
case MediaType.MOVIE: {
const profileName = radarrServers
.find((serverr) => serverr.id === r.serverId)
?.profiles.find((profile) => profile.id === r.profileId)?.name;
?.profiles?.find((profile) => profile.id === r.profileId)?.name;

return {
...r,
Expand All @@ -197,7 +197,7 @@ requestRoutes.get<Record<string, unknown>, RequestResultsResponse>(
...r,
profileName: sonarrServers
.find((serverr) => serverr.id === r.serverId)
?.profiles.find((profile) => profile.id === r.profileId)?.name,
?.profiles?.find((profile) => profile.id === r.profileId)?.name,
};
}
}
Expand Down

0 comments on commit 04813a5

Please sign in to comment.