feat: radarr release type to calendar widget (#1256)

* feat: add release type

* fix: type check

* fix: deepSource

* fix: new approach

* fix: deepSource

* fix: typecheck

* fix: reviewed changes
This commit is contained in:
Yossi Hillali
2024-10-14 11:38:13 +03:00
committed by GitHub
parent 1bc470a39f
commit 98b62a9f91
7 changed files with 78 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
import { IconCalendar } from "@tabler/icons-react";
import { getIntegrationKindsByCategory } from "@homarr/definitions";
import { radarrReleaseTypes } from "@homarr/integrations/types";
import { z } from "@homarr/validation";
import { createWidgetDefinition } from "../definition";
@@ -9,6 +10,13 @@ import { optionsBuilder } from "../options";
export const { definition, componentLoader } = createWidgetDefinition("calendar", {
icon: IconCalendar,
options: optionsBuilder.from((factory) => ({
releaseType: factory.multiSelect({
defaultValue: ["inCinemas", "digitalRelease"],
options: radarrReleaseTypes.map((value) => ({
value,
label: (t) => t(`widget.calendar.option.releaseType.options.${value}`),
})),
}),
filterPastMonths: factory.number({
validate: z.number().min(2).max(9999),
defaultValue: 2,