From 76e02cf148868eff35173eda8ddc068bdb011d99 Mon Sep 17 00:00:00 2001 From: Larvey <39219859+LarveyOfficial@users.noreply.github.com> Date: Tue, 7 Jun 2022 11:19:53 -0400 Subject: [PATCH 1/7] Fix for timezone issues --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 98fe3bdbe..39faff156 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,5 +9,6 @@ COPY /.next/standalone ./ COPY /.next/static ./.next/static EXPOSE 7575 ENV PORT 7575 +RUN apk add tzdata VOLUME /app/data/configs CMD ["node", "server.js"] From fb291c5411f9e7a4d4e140f8482d13fc29e765e1 Mon Sep 17 00:00:00 2001 From: ajnart Date: Tue, 7 Jun 2022 19:34:24 +0200 Subject: [PATCH 2/7] :bug: Trying to fix dates --- src/components/modules/calendar/CalendarModule.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/modules/calendar/CalendarModule.tsx b/src/components/modules/calendar/CalendarModule.tsx index 211108463..4f3c9e492 100644 --- a/src/components/modules/calendar/CalendarModule.tsx +++ b/src/components/modules/calendar/CalendarModule.tsx @@ -111,27 +111,27 @@ function DayComponent(props: any) { props; const [opened, setOpened] = useState(false); - const day = renderdate.getDate(); + const day = renderdate.toDateString(); const readarrFiltered = readarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); const lidarrFiltered = lidarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); // Return true if the date is renerdate without counting hours and minutes - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); const sonarrFiltered = sonarrmedias.filter((media: any) => { const date = new Date(media.airDate); // Return true if the date is renerdate without counting hours and minutes - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); const radarrFiltered = radarrmedias.filter((media: any) => { const date = new Date(media.inCinemas); // Return true if the date is renerdate without counting hours and minutes - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); if ( sonarrFiltered.length === 0 && From 84ae49ed2a7fa28cb2cc08640954d2d435de36ae Mon Sep 17 00:00:00 2001 From: ajnart Date: Tue, 7 Jun 2022 19:34:58 +0200 Subject: [PATCH 3/7] :bricks: Try to fix cookies issues --- src/components/Config/ConfigChanger.tsx | 2 +- src/components/Config/LoadConfig.tsx | 5 ++++- src/pages/login.tsx | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/Config/ConfigChanger.tsx b/src/components/Config/ConfigChanger.tsx index 5b8836803..fa4920242 100644 --- a/src/components/Config/ConfigChanger.tsx +++ b/src/components/Config/ConfigChanger.tsx @@ -26,7 +26,7 @@ export default function ConfigChanger() { label="Config loader" onChange={(e) => { loadConfig(e ?? 'default'); - setCookies('config-name', e ?? 'default', { maxAge: 60 * 60 * 24 * 30 }); + setCookies('config-name', e ?? 'default', { maxAge: 60 * 60 * 24 * 30, sameSite: 'strict' }); }} data={ // If config list is empty, return the current config diff --git a/src/components/Config/LoadConfig.tsx b/src/components/Config/LoadConfig.tsx index 1dbed5988..e98550b6a 100644 --- a/src/components/Config/LoadConfig.tsx +++ b/src/components/Config/LoadConfig.tsx @@ -90,7 +90,10 @@ export default function LoadConfigComponent(props: any) { icon: , message: undefined, }); - setCookies('config-name', newConfig.name, { maxAge: 60 * 60 * 24 * 30 }); + setCookies('config-name', newConfig.name, { + maxAge: 60 * 60 * 24 * 30, + sameSite: 'strict', + }); const migratedConfig = migrateToIdConfig(newConfig); setConfig(migratedConfig); }); diff --git a/src/pages/login.tsx b/src/pages/login.tsx index b6042106b..0f5ca4375 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -43,7 +43,7 @@ export default function AuthenticationTitle() { onSubmit={form.onSubmit((values) => { setCookies('password', values.password, { maxAge: 60 * 60 * 24 * 30, - sameSite: 'strict', + sameSite: 'lax', }); showNotification({ id: 'load-data', From de6e0f645faf5262f77ca92a3ea21956eb929277 Mon Sep 17 00:00:00 2001 From: Larvey <39219859+LarveyOfficial@users.noreply.github.com> Date: Tue, 7 Jun 2022 22:05:28 -0400 Subject: [PATCH 4/7] Fix Sonarr Incorrect Dates Due to how Sonarr gives dates, they recommend using UTC time when displaying it as it matches their calendar. Took some digging but it fixed it. --- src/components/modules/calendar/CalendarModule.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/modules/calendar/CalendarModule.tsx b/src/components/modules/calendar/CalendarModule.tsx index 4f3c9e492..e3e6123e3 100644 --- a/src/components/modules/calendar/CalendarModule.tsx +++ b/src/components/modules/calendar/CalendarModule.tsx @@ -111,27 +111,26 @@ function DayComponent(props: any) { props; const [opened, setOpened] = useState(false); - const day = renderdate.toDateString(); + const day = renderdate.getDate(); const readarrFiltered = readarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); - return date.toDateString() === day; + return date.getDate() === day && date.getMonth() === renderdate.getMonth(); }); const lidarrFiltered = lidarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); // Return true if the date is renerdate without counting hours and minutes - return date.toDateString() === day; + return date.getDate() === day && date.getMonth() === renderdate.getMonth(); }); const sonarrFiltered = sonarrmedias.filter((media: any) => { - const date = new Date(media.airDate); - // Return true if the date is renerdate without counting hours and minutes - return date.toDateString() === day; + const date = new Date(media.airDateUtc); + return date.getDate() === day && date.getMonth() === renderdate.getMonth(); }); const radarrFiltered = radarrmedias.filter((media: any) => { const date = new Date(media.inCinemas); // Return true if the date is renerdate without counting hours and minutes - return date.toDateString() === day; + return date.getDate() === day && date.getMonth() === renderdate.getMonth(); }); if ( sonarrFiltered.length === 0 && From 4dac73041279c3a2cae88ce4bb4ac794d95475de Mon Sep 17 00:00:00 2001 From: ajnart Date: Wed, 8 Jun 2022 08:09:59 +0200 Subject: [PATCH 5/7] :twisted_rightwards_arrows: Rebase with dev --- src/components/modules/calendar/CalendarModule.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/modules/calendar/CalendarModule.tsx b/src/components/modules/calendar/CalendarModule.tsx index e3e6123e3..1272bbafb 100644 --- a/src/components/modules/calendar/CalendarModule.tsx +++ b/src/components/modules/calendar/CalendarModule.tsx @@ -111,26 +111,26 @@ function DayComponent(props: any) { props; const [opened, setOpened] = useState(false); - const day = renderdate.getDate(); + const day = renderdate.toDateString(); const readarrFiltered = readarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); const lidarrFiltered = lidarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); // Return true if the date is renerdate without counting hours and minutes - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); const sonarrFiltered = sonarrmedias.filter((media: any) => { const date = new Date(media.airDateUtc); - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); const radarrFiltered = radarrmedias.filter((media: any) => { const date = new Date(media.inCinemas); // Return true if the date is renerdate without counting hours and minutes - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); if ( sonarrFiltered.length === 0 && From f75da289c2783c6860a4bee9b1395b7d7d311d1c Mon Sep 17 00:00:00 2001 From: ajnart Date: Wed, 8 Jun 2022 09:56:04 +0200 Subject: [PATCH 6/7] :ambulance: Hotfix calendar and mobile responsiveness --- src/components/modules/calendar/CalendarModule.tsx | 12 +++++------- src/components/modules/common/MediaDisplay.tsx | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/modules/calendar/CalendarModule.tsx b/src/components/modules/calendar/CalendarModule.tsx index 1272bbafb..c95893545 100644 --- a/src/components/modules/calendar/CalendarModule.tsx +++ b/src/components/modules/calendar/CalendarModule.tsx @@ -111,26 +111,24 @@ function DayComponent(props: any) { props; const [opened, setOpened] = useState(false); - const day = renderdate.toDateString(); + const day = renderdate.getDate(); const readarrFiltered = readarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); - return date.toDateString() === day; + return date.toDateString() === renderdate.toDateString(); }); const lidarrFiltered = lidarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); - // Return true if the date is renerdate without counting hours and minutes - return date.toDateString() === day; + return date.toDateString() === renderdate.toDateString(); }); const sonarrFiltered = sonarrmedias.filter((media: any) => { const date = new Date(media.airDateUtc); - return date.toDateString() === day; + return date.toDateString() === renderdate.toDateString(); }); const radarrFiltered = radarrmedias.filter((media: any) => { const date = new Date(media.inCinemas); - // Return true if the date is renerdate without counting hours and minutes - return date.toDateString() === day; + return date.toDateString() === renderdate.toDateString(); }); if ( sonarrFiltered.length === 0 && diff --git a/src/components/modules/common/MediaDisplay.tsx b/src/components/modules/common/MediaDisplay.tsx index bd8297da1..74373a6cc 100644 --- a/src/components/modules/common/MediaDisplay.tsx +++ b/src/components/modules/common/MediaDisplay.tsx @@ -53,7 +53,7 @@ export function MediaDisplay(props: { media: IMedia }) { alt={media.title} /> )} - + {media.title} {media.imdbId && ( From d631865f71ce0b3ad759e0acd60f79f8c5a30ca7 Mon Sep 17 00:00:00 2001 From: ajnart Date: Wed, 8 Jun 2022 18:41:22 +0200 Subject: [PATCH 7/7] :lipstick: Small UI qol update Module download now has a different look and can be toggled on and off --- src/components/AppShelf/AppShelf.tsx | 9 ++++-- src/components/Config/ConfigChanger.tsx | 5 ++- src/components/Settings/CommonSettings.tsx | 9 +----- .../modules/downloads/DownloadsModule.tsx | 3 +- src/components/modules/moduleWrapper.tsx | 31 ++++++++++++++----- 5 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/components/AppShelf/AppShelf.tsx b/src/components/AppShelf/AppShelf.tsx index 422435052..ede6a307f 100644 --- a/src/components/AppShelf/AppShelf.tsx +++ b/src/components/AppShelf/AppShelf.tsx @@ -15,8 +15,9 @@ import { useLocalStorage } from '@mantine/hooks'; import { useConfig } from '../../tools/state'; import { SortableAppShelfItem, AppShelfItem } from './AppShelfItem'; -import { ModuleWrapper } from '../modules/moduleWrapper'; +import { ModuleMenu, ModuleWrapper } from '../modules/moduleWrapper'; import { DownloadsModule } from '../modules'; +import DownloadComponent from '../modules/downloads/DownloadsModule'; const useStyles = createStyles((theme, _params) => ({ item: { @@ -137,6 +138,7 @@ const AppShelf = (props: any) => { // Return one item for each category { {item()} ) : null} + + + + - ); } diff --git a/src/components/Config/ConfigChanger.tsx b/src/components/Config/ConfigChanger.tsx index fa4920242..a34846556 100644 --- a/src/components/Config/ConfigChanger.tsx +++ b/src/components/Config/ConfigChanger.tsx @@ -26,7 +26,10 @@ export default function ConfigChanger() { label="Config loader" onChange={(e) => { loadConfig(e ?? 'default'); - setCookies('config-name', e ?? 'default', { maxAge: 60 * 60 * 24 * 30, sameSite: 'strict' }); + setCookies('config-name', e ?? 'default', { + maxAge: 60 * 60 * 24 * 30, + sameSite: 'strict', + }); }} data={ // If config list is empty, return the current config diff --git a/src/components/Settings/CommonSettings.tsx b/src/components/Settings/CommonSettings.tsx index 3f244c0b6..c61b6d605 100644 --- a/src/components/Settings/CommonSettings.tsx +++ b/src/components/Settings/CommonSettings.tsx @@ -1,11 +1,4 @@ -import { - ActionIcon, - Group, - Text, - SegmentedControl, - TextInput, - Anchor, -} from '@mantine/core'; +import { ActionIcon, Group, Text, SegmentedControl, TextInput, Anchor } from '@mantine/core'; import { useState } from 'react'; import { IconBrandGithub as BrandGithub } from '@tabler/icons'; import { CURRENT_VERSION } from '../../../data/constants'; diff --git a/src/components/modules/downloads/DownloadsModule.tsx b/src/components/modules/downloads/DownloadsModule.tsx index 84a013955..527a6e835 100644 --- a/src/components/modules/downloads/DownloadsModule.tsx +++ b/src/components/modules/downloads/DownloadsModule.tsx @@ -136,8 +136,7 @@ export default function DownloadComponent() { ); return ( - - Your torrents + {rows.length > 0 ? ( diff --git a/src/components/modules/moduleWrapper.tsx b/src/components/modules/moduleWrapper.tsx index 15a8df738..2d974e53b 100644 --- a/src/components/modules/moduleWrapper.tsx +++ b/src/components/modules/moduleWrapper.tsx @@ -1,4 +1,4 @@ -import { Button, Card, Group, Menu, Switch, TextInput, useMantineTheme } from '@mantine/core'; +import { Button, Card, Group, Menu, Switch, TextInput } from '@mantine/core'; import { useConfig } from '../../tools/state'; import { IModule } from './modules'; @@ -95,14 +95,32 @@ export function ModuleWrapper(props: any) { const enabledModules = config.modules ?? {}; // Remove 'Module' from enabled modules titles const isShown = enabledModules[module.title]?.enabled ?? false; - const theme = useMantineTheme(); - const items: JSX.Element[] = getItems(module); if (!isShown) { return null; } return ( + ); +} + +export function ModuleMenu(props: any) { + const { module, styles } = props; + const items: JSX.Element[] = getItems(module); + return ( + <> {module.options && ( )} - - + ); }