Add a toggle to show unmonitored items in *Arr (#1371)

This commit is contained in:
Thomas Camlong
2023-09-07 21:36:15 +02:00
committed by GitHub
parent 3ede6219ef
commit 39c16c3d29
3 changed files with 12 additions and 2 deletions

View File

@@ -21,6 +21,9 @@
"hideWeekDays": { "hideWeekDays": {
"label": "Hide week days" "label": "Hide week days"
}, },
"showUnmonitored": {
"label": "Show unmonitored items"
},
"fontSize": { "fontSize": {
"label": "Font Size", "label": "Font Size",
"data":{ "data":{

View File

@@ -16,6 +16,7 @@ export const calendarRouter = createTRPCRouter({
year: z.number().min(1900).max(2300), year: z.number().min(1900).max(2300),
options: z.object({ options: z.object({
useSonarrv4: z.boolean().optional().default(false), useSonarrv4: z.boolean().optional().default(false),
showUnmonitored: z.boolean().optional().default(false),
}), }),
}) })
) )
@@ -64,7 +65,9 @@ export const calendarRouter = createTRPCRouter({
if (!apiKey) return { type: integration.type, items: [], success: false }; if (!apiKey) return { type: integration.type, items: [], success: false };
return axios return axios
.get( .get(
`${origin}${endpoint}?apiKey=${apiKey}&end=${end.toISOString()}&start=${start.toISOString()}&includeSeries=true&includeEpisodeFile=true&includeEpisodeImages=true` `${origin}${endpoint}?apiKey=${apiKey}&end=${end.toISOString()}&start=${start.toISOString()}&includeSeries=true&includeEpisodeFile=true&includeEpisodeImages=true&&unmonitored=${
input.options.showUnmonitored
}`
) )
.then((x) => ({ type: integration.type, items: x.data as any[], success: true })) .then((x) => ({ type: integration.type, items: x.data as any[], success: true }))
.catch((err) => { .catch((err) => {

View File

@@ -22,6 +22,10 @@ const definition = defineWidget({
type: 'switch', type: 'switch',
defaultValue: true, defaultValue: true,
}, },
showUnmonitored: {
type: 'switch',
defaultValue: false,
},
useSonarrv4: { useSonarrv4: {
type: 'switch', type: 'switch',
defaultValue: false, defaultValue: false,
@@ -81,7 +85,7 @@ function CalendarTile({ widget }: CalendarTileProps) {
configName: configName!, configName: configName!,
month: month.getMonth() + 1, month: month.getMonth() + 1,
year: month.getFullYear(), year: month.getFullYear(),
options: { useSonarrv4: widget.properties.useSonarrv4 }, options: { useSonarrv4: widget.properties.useSonarrv4, showUnmonitored: widget.properties.showUnmonitored },
}, },
{ {
staleTime: 1000 * 60 * 60 * 5, staleTime: 1000 * 60 * 60 * 5,