readarr get author
This commit is contained in:
parent
4f5433b014
commit
97dd781aca
@ -8,7 +8,7 @@ import Error from "../../../components/services/widget/error";
|
|||||||
export default function Integration({ config, params }) {
|
export default function Integration({ config, params }) {
|
||||||
const { setEvents } = useContext(EventContext);
|
const { setEvents } = useContext(EventContext);
|
||||||
const { data: readarrData, error: readarrError } = useWidgetAPI(config, "calendar",
|
const { data: readarrData, error: readarrError } = useWidgetAPI(config, "calendar",
|
||||||
{ ...params, includeAuthor: 'false', ...config?.params ?? {} },
|
{ ...params, includeAuthor: 'true', ...config?.params ?? {} },
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -19,7 +19,7 @@ export default function Integration({ config, params }) {
|
|||||||
const eventsToAdd = {};
|
const eventsToAdd = {};
|
||||||
|
|
||||||
readarrData?.forEach(event => {
|
readarrData?.forEach(event => {
|
||||||
const authorName = event.authorTitle.replace(event.title, '');
|
const authorName = event.author?.authorName ?? event.authorTitle.replace(event.title, '');
|
||||||
const title = `${authorName} - ${event.title} ${event?.seriesTitle ? `(${event.seriesTitle})` : ''} `;
|
const title = `${authorName} - ${event.title} ${event?.seriesTitle ? `(${event.seriesTitle})` : ''} `;
|
||||||
|
|
||||||
eventsToAdd[title] = {
|
eventsToAdd[title] = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user