From b3a20e9e0b7bd2b531cd5604c85a2810b7697410 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 1 Jun 2019 16:48:44 -0400 Subject: [PATCH] New: Change PastDays and FutureDays for ICal Feed in UI Makes #817 easy --- .../Calendar/iCal/CalendarLinkModalContent.js | 42 ++++++++----------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/frontend/src/Calendar/iCal/CalendarLinkModalContent.js b/frontend/src/Calendar/iCal/CalendarLinkModalContent.js index ea4d64fe9..074c66516 100644 --- a/frontend/src/Calendar/iCal/CalendarLinkModalContent.js +++ b/frontend/src/Calendar/iCal/CalendarLinkModalContent.js @@ -17,8 +17,8 @@ import ModalFooter from 'Components/Modal/ModalFooter'; function getUrls(state) { const { unmonitored, - premieresOnly, - asAllDay, + pastDays, + futureDays, tags } = state; @@ -28,19 +28,11 @@ function getUrls(state) { icalUrl += 'unmonitored=true&'; } - if (premieresOnly) { - icalUrl += 'premieresOnly=true&'; - } - - if (asAllDay) { - icalUrl += 'asAllDay=true&'; - } - if (tags.length) { icalUrl += `tags=${tags.toString()}&`; } - icalUrl += `apikey=${window.Lidarr.apiKey}`; + icalUrl += `pastDays=${pastDays}&futureDays=${futureDays}&apikey=${window.Lidarr.apiKey}`; const iCalHttpUrl = `${window.location.protocol}//${icalUrl}`; const iCalWebCalUrl = `webcal://${icalUrl}`; @@ -61,8 +53,8 @@ class CalendarLinkModalContent extends Component { const defaultState = { unmonitored: false, - premieresOnly: false, - asAllDay: false, + pastDays: 7, + futureDays: 28, tags: [] }; @@ -105,8 +97,8 @@ class CalendarLinkModalContent extends Component { const { unmonitored, - premieresOnly, - asAllDay, + pastDays, + futureDays, tags, iCalHttpUrl, iCalWebCalUrl @@ -133,25 +125,25 @@ class CalendarLinkModalContent extends Component { - Season Premieres Only + Past Days - Show as All-Day Events + Future Days