From 35f02a2296ffda6442a308926fcc337c7203a837 Mon Sep 17 00:00:00 2001 From: Larvey <39219859+LarveyOfficial@users.noreply.github.com> Date: Mon, 20 Jun 2022 14:02:33 -0400 Subject: [PATCH] Fix URL for Radarr and other services --- src/pages/api/modules/calendar.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/api/modules/calendar.ts b/src/pages/api/modules/calendar.ts index 70d2c2f4c..8ebd1c3d3 100644 --- a/src/pages/api/modules/calendar.ts +++ b/src/pages/api/modules/calendar.ts @@ -44,7 +44,10 @@ async function Post(req: NextApiRequest, res: NextApiResponse) { }); } // Get the origin URL - const { href: origin } = new URL(service.url); + var { href: origin } = new URL(service.url); + if (origin.endsWith("/")) { + origin = origin.slice(0, -1) + } const pined = `${origin}${url?.url}?apiKey=${service.apiKey}&end=${nextMonth}&start=${lastMonth}`; const data = await axios.get( `${origin}${url?.url}?apiKey=${service.apiKey}&end=${nextMonth}&start=${lastMonth}`