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")}`;
if (event.inCinemas) {
eventsToAdd[cinemaTitle] = { eventsToAdd[cinemaTitle] = {
title: cinemaTitle, title: cinemaTitle,
date: DateTime.fromISO(event.inCinemas), date: DateTime.fromISO(event.inCinemas),
color: config?.color ?? "amber", color: config?.color ?? "amber",
isCompleted: event.isAvailable, isCompleted: event.hasFile,
additional: "", additional: "",
}; };
}
if (event.physicalRelease) {
eventsToAdd[physicalTitle] = { eventsToAdd[physicalTitle] = {
title: physicalTitle, title: physicalTitle,
date: DateTime.fromISO(event.physicalRelease), date: DateTime.fromISO(event.physicalRelease),
color: config?.color ?? "cyan", color: config?.color ?? "cyan",
isCompleted: event.isAvailable, isCompleted: event.hasFile,
additional: "", additional: "",
}; };
}
if (event.digitalRelease) {
eventsToAdd[digitalTitle] = { eventsToAdd[digitalTitle] = {
title: digitalTitle, title: digitalTitle,
date: DateTime.fromISO(event.digitalRelease), date: DateTime.fromISO(event.digitalRelease),
color: config?.color ?? "emerald", color: config?.color ?? "emerald",
isCompleted: event.isAvailable, isCompleted: event.hasFile,
additional: "", additional: "",
}; };
}
}); });
setEvents((prevEvents) => ({ ...prevEvents, ...eventsToAdd })); setEvents((prevEvents) => ({ ...prevEvents, ...eventsToAdd }));

Loading…
Cancel
Save