1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-20 21:54:58 -04:00

Move unknown series queue items to filter instead of option

This commit is contained in:
Mark McDowall
2025-12-24 10:51:25 -08:00
parent a466a94d4d
commit 2d071eca9b
8 changed files with 26 additions and 90 deletions
@@ -1,5 +1,4 @@
import useApiQuery from 'Helpers/Hooks/useApiQuery';
import { useQueueOption } from '../queueOptionsStore';
export interface QueueStatus {
totalCount: number;
@@ -12,13 +11,8 @@ export interface QueueStatus {
}
export default function useQueueStatus() {
const includeUnknownSeriesItems = useQueueOption('includeUnknownSeriesItems');
const { data } = useApiQuery<QueueStatus>({
path: '/queue/status',
queryParams: {
includeUnknownSeriesItems,
},
});
if (!data) {
@@ -29,26 +23,11 @@ export default function useQueueStatus() {
};
}
const {
errors,
warnings,
unknownErrors,
unknownWarnings,
count,
totalCount,
} = data;
if (includeUnknownSeriesItems) {
return {
count: totalCount,
errors: errors || unknownErrors,
warnings: warnings || unknownWarnings,
};
}
const { errors, warnings, unknownErrors, unknownWarnings, totalCount } = data;
return {
count,
errors,
warnings,
count: totalCount,
errors: errors || unknownErrors,
warnings: warnings || unknownWarnings,
};
}