Enhancement: Improvements to calendar Radarr release logic (#2374)

Signed-off-by: Denis Papec <denis.papec@gmail.com>
pull/2376/head
Denis Papec 1 year ago committed by GitHub
parent fb9ebf18ba
commit acafbb5100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,27 +25,35 @@ export default function Integration({ config, params, hideErrors = false }) {
const physicalTitle = `${event.title} - ${t("calendar.physicalRelease")}`; const physicalTitle = `${event.title} - ${t("calendar.physicalRelease")}`;
const digitalTitle = `${event.title} - ${t("calendar.digitalRelease")}`; const digitalTitle = `${event.title} - ${t("calendar.digitalRelease")}`;
eventsToAdd[cinemaTitle] = { if (event.inCinemas) {
title: cinemaTitle, eventsToAdd[cinemaTitle] = {
date: DateTime.fromISO(event.inCinemas), title: cinemaTitle,
color: config?.color ?? "amber", date: DateTime.fromISO(event.inCinemas),
isCompleted: event.isAvailable, color: config?.color ?? "amber",
additional: "", isCompleted: event.hasFile,
}; additional: "",
eventsToAdd[physicalTitle] = { };
title: physicalTitle, }
date: DateTime.fromISO(event.physicalRelease),
color: config?.color ?? "cyan", if (event.physicalRelease) {
isCompleted: event.isAvailable, eventsToAdd[physicalTitle] = {
additional: "", title: physicalTitle,
}; date: DateTime.fromISO(event.physicalRelease),
eventsToAdd[digitalTitle] = { color: config?.color ?? "cyan",
title: digitalTitle, isCompleted: event.hasFile,
date: DateTime.fromISO(event.digitalRelease), additional: "",
color: config?.color ?? "emerald", };
isCompleted: event.isAvailable, }
additional: "",
}; if (event.digitalRelease) {
eventsToAdd[digitalTitle] = {
title: digitalTitle,
date: DateTime.fromISO(event.digitalRelease),
color: config?.color ?? "emerald",
isCompleted: event.hasFile,
additional: "",
};
}
}); });
setEvents((prevEvents) => ({ ...prevEvents, ...eventsToAdd })); setEvents((prevEvents) => ({ ...prevEvents, ...eventsToAdd }));

Loading…
Cancel
Save