✨ Add a toggle to show unmonitored items in *Arr (#1371)
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
"hideWeekDays": {
|
||||
"label": "Hide week days"
|
||||
},
|
||||
"showUnmonitored": {
|
||||
"label": "Show unmonitored items"
|
||||
},
|
||||
"fontSize": {
|
||||
"label": "Font Size",
|
||||
"data":{
|
||||
|
||||
@@ -16,6 +16,7 @@ export const calendarRouter = createTRPCRouter({
|
||||
year: z.number().min(1900).max(2300),
|
||||
options: z.object({
|
||||
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 };
|
||||
return axios
|
||||
.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 }))
|
||||
.catch((err) => {
|
||||
|
||||
@@ -22,6 +22,10 @@ const definition = defineWidget({
|
||||
type: 'switch',
|
||||
defaultValue: true,
|
||||
},
|
||||
showUnmonitored: {
|
||||
type: 'switch',
|
||||
defaultValue: false,
|
||||
},
|
||||
useSonarrv4: {
|
||||
type: 'switch',
|
||||
defaultValue: false,
|
||||
@@ -81,7 +85,7 @@ function CalendarTile({ widget }: CalendarTileProps) {
|
||||
configName: configName!,
|
||||
month: month.getMonth() + 1,
|
||||
year: month.getFullYear(),
|
||||
options: { useSonarrv4: widget.properties.useSonarrv4 },
|
||||
options: { useSonarrv4: widget.properties.useSonarrv4, showUnmonitored: widget.properties.showUnmonitored },
|
||||
},
|
||||
{
|
||||
staleTime: 1000 * 60 * 60 * 5,
|
||||
|
||||
Reference in New Issue
Block a user