From fa443c05bedfca8208bfb05ab02c3b0e678e4ca0 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Mon, 16 Dec 2024 16:41:59 +0100 Subject: [PATCH] fix(discover): display recent requests even if there is an error with *arr (#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. --- server/routes/request.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/routes/request.ts b/server/routes/request.ts index df75d9ce8..583f01f5e 100644 --- a/server/routes/request.ts +++ b/server/routes/request.ts @@ -159,7 +159,7 @@ requestRoutes.get, RequestResultsResponse>( return { id: sonarrSetting.id, - profiles: await sonarr.getProfiles(), + profiles: await sonarr.getProfiles().catch(() => undefined), }; }) ); @@ -174,7 +174,7 @@ requestRoutes.get, RequestResultsResponse>( return { id: radarrSetting.id, - profiles: await radarr.getProfiles(), + profiles: await radarr.getProfiles().catch(() => undefined), }; }) ); @@ -185,7 +185,7 @@ requestRoutes.get, 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, @@ -197,7 +197,7 @@ requestRoutes.get, 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, }; } }