✨ Add a toggle to show unmonitored items in *Arr (#1371)
This commit is contained in:
@@ -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":{
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user