mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Run pre-commit hooks over existing codebase
Co-Authored-By: Ben Phelps <ben@phelps.io>
This commit is contained in:
@@ -7,9 +7,11 @@ import Error from "../../../components/services/widget/error";
|
||||
|
||||
export default function Integration({ config, params }) {
|
||||
const { setEvents } = useContext(EventContext);
|
||||
const { data: readarrData, error: readarrError } = useWidgetAPI(config, "calendar",
|
||||
{ ...params, includeAuthor: 'true', ...config?.params ?? {} },
|
||||
);
|
||||
const { data: readarrData, error: readarrError } = useWidgetAPI(config, "calendar", {
|
||||
...params,
|
||||
includeAuthor: "true",
|
||||
...(config?.params ?? {}),
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!readarrData || readarrError) {
|
||||
@@ -18,20 +20,20 @@ export default function Integration({ config, params }) {
|
||||
|
||||
const eventsToAdd = {};
|
||||
|
||||
readarrData?.forEach(event => {
|
||||
const authorName = event.author?.authorName ?? event.authorTitle.replace(event.title, '');
|
||||
const title = `${authorName} - ${event.title} ${event?.seriesTitle ? `(${event.seriesTitle})` : ''} `;
|
||||
readarrData?.forEach((event) => {
|
||||
const authorName = event.author?.authorName ?? event.authorTitle.replace(event.title, "");
|
||||
const title = `${authorName} - ${event.title} ${event?.seriesTitle ? `(${event.seriesTitle})` : ""} `;
|
||||
|
||||
eventsToAdd[title] = {
|
||||
title,
|
||||
date: DateTime.fromISO(event.releaseDate),
|
||||
color: config?.color ?? 'rose'
|
||||
color: config?.color ?? "rose",
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
setEvents((prevEvents) => ({ ...prevEvents, ...eventsToAdd }));
|
||||
}, [readarrData, readarrError, config, setEvents]);
|
||||
|
||||
const error = readarrError ?? readarrData?.error;
|
||||
return error && <Error error={{ message: `${config.type}: ${error.message ?? error}`}} />
|
||||
return error && <Error error={{ message: `${config.type}: ${error.message ?? error}` }} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user