diff --git a/components/calendar/CalendarComponent.tsx b/components/calendar/CalendarComponent.tsx
index 496ca8ec3..53b3695f4 100644
--- a/components/calendar/CalendarComponent.tsx
+++ b/components/calendar/CalendarComponent.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable react/no-children-prop */
import { Indicator, Popover, Box, Center, ScrollArea, Divider } from '@mantine/core';
import { useEffect, useState } from 'react';
import { Calendar } from '@mantine/dates';
@@ -29,7 +30,7 @@ export default function CalendarComponent(props: any) {
}
if (radarrService) {
fetch(
- `${radarrService?.url}api/calendar?apikey=${radarrService?.apiKey}&end=${nextMonth}`
+ `${radarrService?.url}api/v3/calendar?apikey=${radarrService?.apiKey}&end=${nextMonth}`
).then((response) => {
response.json().then((data) => setRadarrMedias(data));
});
@@ -39,7 +40,6 @@ export default function CalendarComponent(props: any) {
if (sonarrMedias === undefined && radarrMedias === undefined) {
return ;
}
-
return (
{}}
@@ -70,7 +70,7 @@ function DayComponent(props: any) {
return date.getDate() === day && date.getMonth() === renderdate.getMonth();
});
const radarrFiltered = radarrmedias.filter((media: any) => {
- const date = new Date(media.airDate);
+ const date = new Date(media.inCinemas);
// Return true if the date is renerdate without counting hours and minutes
return date.getDate() === day && date.getMonth() === renderdate.getMonth();
});
@@ -89,7 +89,13 @@ function DayComponent(props: any) {
>
{/* TODO: #6 Make the color of the indicator dependant on the type of medias avilable */}
-
+ <>
+ {radarrFiltered.length > 0 && (
+
+ )}
+ {sonarrFiltered.length > 0 && (
+
+ )}
{sonarrFiltered.length > 0 && }
-
+ {(radarrFiltered.length > 0 && sonarrFiltered.length > 0) && }
{radarrFiltered.length > 0 && }
-
+ >
);
diff --git a/components/calendar/MediaDisplay.tsx b/components/calendar/MediaDisplay.tsx
index 849af0c21..6f3be4186 100644
--- a/components/calendar/MediaDisplay.tsx
+++ b/components/calendar/MediaDisplay.tsx
@@ -13,14 +13,14 @@ export interface IMedia {
export function RadarrMediaDisplay(props: any) {
const { media }: { media: any } = props;
// Find a poster CoverType
- const poster = media.series.images.find((image: any) => image.coverType === 'poster');
+ const poster = media.images.find((image: any) => image.coverType === 'poster');
// Return a movie poster containting the title and the description
return (
- {media.series.title}
-
+ {media.title}
+
-
- Season {media.seasonNumber} episode {media.episodeNumber}
-
- {media.series.overview}
+ {media.overview}
{/*Add the genres at the bottom of the poster*/}
- {media.series.genres.map((genre: string, i: number) => (
+ {media.genres.map((genre: string, i: number) => (
{genre}
))}
@@ -69,12 +61,11 @@ export function SonarrMediaDisplay(props: any) {
return (