Fix Calendar Item Duplication

- 6fd23cf6a0 changed how items for the calendar are acquired, making it so every series gets updated when a new one gets added, or one gets moved. This causes the entries in the calendar to duplicate due to old code being left in.
This commit is contained in:
Larvey
2022-06-20 13:32:31 -04:00
committed by GitHub
parent 690f09fcf3
commit 16ec57081b

View File

@@ -68,7 +68,7 @@ export default function CalendarComponent(props: any) {
useEffect(() => { useEffect(() => {
// Create each Sonarr service and get the medias // Create each Sonarr service and get the medias
const currentSonarrMedias: any[] = [...sonarrMedias]; const currentSonarrMedias: any[] = [];
Promise.all( Promise.all(
sonarrServices.map((service) => sonarrServices.map((service) =>
getMedias(service, 'sonarr').then((res) => { getMedias(service, 'sonarr').then((res) => {
@@ -80,7 +80,7 @@ export default function CalendarComponent(props: any) {
).then(() => { ).then(() => {
setSonarrMedias(currentSonarrMedias); setSonarrMedias(currentSonarrMedias);
}); });
const currentRadarrMedias: any[] = [...radarrMedias]; const currentRadarrMedias: any[] = [];
Promise.all( Promise.all(
radarrServices.map((service) => radarrServices.map((service) =>
getMedias(service, 'radarr').then((res) => { getMedias(service, 'radarr').then((res) => {
@@ -92,7 +92,7 @@ export default function CalendarComponent(props: any) {
).then(() => { ).then(() => {
setRadarrMedias(currentRadarrMedias); setRadarrMedias(currentRadarrMedias);
}); });
const currentLidarrMedias: any[] = [...lidarrMedias]; const currentLidarrMedias: any[] = [];
Promise.all( Promise.all(
lidarrServices.map((service) => lidarrServices.map((service) =>
getMedias(service, 'lidarr').then((res) => { getMedias(service, 'lidarr').then((res) => {
@@ -104,7 +104,7 @@ export default function CalendarComponent(props: any) {
).then(() => { ).then(() => {
setLidarrMedias(currentLidarrMedias); setLidarrMedias(currentLidarrMedias);
}); });
const currentReadarrMedias: any[] = [...readarrMedias]; const currentReadarrMedias: any[] = [];
Promise.all( Promise.all(
readarrServices.map((service) => readarrServices.map((service) =>
getMedias(service, 'readarr').then((res) => { getMedias(service, 'readarr').then((res) => {