From 2d071eca9bca1128620e0dfa89f7901285bcce5b Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 24 Dec 2025 10:51:25 -0800 Subject: [PATCH] Move unknown series queue items to filter instead of option --- .../Activity/History/historyOptionsStore.ts | 1 - frontend/src/Activity/Queue/Queue.tsx | 3 -- frontend/src/Activity/Queue/QueueOptions.tsx | 46 ------------------- .../Activity/Queue/Status/useQueueStatus.ts | 29 ++---------- .../src/Activity/Queue/queueOptionsStore.ts | 2 - frontend/src/Activity/Queue/useQueue.ts | 29 ++++++++---- src/NzbDrone.Core/Localization/Core/en.json | 4 +- src/Sonarr.Api.V5/Queue/QueueController.cs | 2 +- 8 files changed, 26 insertions(+), 90 deletions(-) delete mode 100644 frontend/src/Activity/Queue/QueueOptions.tsx diff --git a/frontend/src/Activity/History/historyOptionsStore.ts b/frontend/src/Activity/History/historyOptionsStore.ts index 9f49b32ee..631c7bc19 100644 --- a/frontend/src/Activity/History/historyOptionsStore.ts +++ b/frontend/src/Activity/History/historyOptionsStore.ts @@ -12,7 +12,6 @@ export type HistoryOptions = PageableOptions; const { useOptions, useOption, setOptions, setOption, setSort } = createOptionsStore('history_options', () => { return { - includeUnknownSeriesItems: true, pageSize: 20, selectedFilterKey: 'all', sortKey: 'time', diff --git a/frontend/src/Activity/Queue/Queue.tsx b/frontend/src/Activity/Queue/Queue.tsx index 2f2d72217..459ff196d 100644 --- a/frontend/src/Activity/Queue/Queue.tsx +++ b/frontend/src/Activity/Queue/Queue.tsx @@ -37,7 +37,6 @@ import { } from 'Utilities/pagePopulator'; import translate from 'Utilities/String/translate'; import QueueFilterModal from './QueueFilterModal'; -import QueueOptions from './QueueOptions'; import { setQueueOption, setQueueOptions, @@ -252,7 +251,6 @@ function QueueContent() { pageSize={pageSize} sortKey={sortKey} sortDirection={sortDirection} - optionsComponent={QueueOptions} onTableOptionChange={handleTableOptionChange} onSelectAllChange={handleSelectAllChange} onSortPress={handleSortPress} @@ -330,7 +328,6 @@ function QueueContent() { columns={columns} pageSize={pageSize} maxPageSize={200} - optionsComponent={QueueOptions} onTableOptionChange={handleTableOptionChange} > ) => { - setQueueOption(name, value); - - if (name === 'includeUnknownSeriesItems') { - goToPage(1); - } - }, - [goToPage] - ); - - return ( - - {translate('ShowUnknownSeriesItems')} - - - - ); -} - -export default QueueOptions; diff --git a/frontend/src/Activity/Queue/Status/useQueueStatus.ts b/frontend/src/Activity/Queue/Status/useQueueStatus.ts index 5102842f2..d739f17d1 100644 --- a/frontend/src/Activity/Queue/Status/useQueueStatus.ts +++ b/frontend/src/Activity/Queue/Status/useQueueStatus.ts @@ -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({ 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, }; } diff --git a/frontend/src/Activity/Queue/queueOptionsStore.ts b/frontend/src/Activity/Queue/queueOptionsStore.ts index b440cf7fa..41e404a0f 100644 --- a/frontend/src/Activity/Queue/queueOptionsStore.ts +++ b/frontend/src/Activity/Queue/queueOptionsStore.ts @@ -13,14 +13,12 @@ interface QueueRemovalOptions { } export interface QueueOptions extends PageableOptions { - includeUnknownSeriesItems: boolean; removalOptions: QueueRemovalOptions; } const { useOptions, useOption, setOptions, setOption, setSort } = createOptionsStore('queue_options', () => { return { - includeUnknownSeriesItems: true, pageSize: 20, selectedFilterKey: 'all', sortKey: 'time', diff --git a/frontend/src/Activity/Queue/useQueue.ts b/frontend/src/Activity/Queue/useQueue.ts index 620181f97..2ff196f5a 100644 --- a/frontend/src/Activity/Queue/useQueue.ts +++ b/frontend/src/Activity/Queue/useQueue.ts @@ -22,6 +22,17 @@ export const FILTERS: Filter[] = [ label: () => translate('All'), filters: [], }, + { + key: 'excludeUnknownSeriesItems', + label: () => translate('ExcludeUnknownSeriesItems'), + filters: [ + { + key: 'includeUnknownSeriesItems', + value: [false], + type: 'equal', + }, + ], + }, ]; export const FILTER_BUILDER: FilterBuilderProp[] = [ @@ -55,17 +66,18 @@ export const FILTER_BUILDER: FilterBuilderProp[] = [ type: 'equal', valueType: filterBuilderValueTypes.QUEUE_STATUS, }, + { + name: 'includeUnknownSeriesItems', + label: () => translate('UnknownSeriesItems'), + type: 'equal', + valueType: filterBuilderValueTypes.BOOL, + }, ]; const useQueue = () => { const { page, goToPage } = usePage('queue'); - const { - includeUnknownSeriesItems, - pageSize, - selectedFilterKey, - sortKey, - sortDirection, - } = useQueueOptions(); + const { pageSize, selectedFilterKey, sortKey, sortDirection } = + useQueueOptions(); const customFilters = useCustomFiltersList('queue'); const filters = useMemo(() => { @@ -77,9 +89,6 @@ const useQueue = () => { page, pageSize, filters, - queryParams: { - includeUnknownSeriesItems, - }, sortKey, sortDirection, queryOptions: { diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 5f29471ae..46b5a8aa2 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -697,6 +697,7 @@ "ExcludedTags": "Excluded Tags", "ExcludedReleaseProfile": "Excluded Release Profile", "ExcludedReleaseProfiles": "Excluded Release Profiles", + "ExcludeUnknownSeriesItems": "Exclude Unknown Series Items", "Existing": "Existing", "ExistingSeries": "Existing Series", "ExistingTag": "Existing tag", @@ -1985,8 +1986,6 @@ "ShowTags": "Show Tags", "ShowTagsHelpText": "Show tags under poster", "ShowTitle": "Show Title", - "ShowUnknownSeriesItems": "Show Unknown Series Items", - "ShowUnknownSeriesItemsHelpText": "Show items without a series in the queue, this could include removed series, movies or anything else in {appName}'s category", "ShownClickToHide": "Shown, click to hide", "Shutdown": "Shutdown", "SingleEpisode": "Single Episode", @@ -2132,6 +2131,7 @@ "Unknown": "Unknown", "UnknownDownloadState": "Unknown download state: {state}", "UnknownEventTooltip": "Unknown event", + "UnknownSeriesItems": "Unknown Series Items", "Unlimited": "Unlimited", "UnmappedFilesOnly": "Unmapped Files Only", "UnmappedFolders": "Unmapped Folders", diff --git a/src/Sonarr.Api.V5/Queue/QueueController.cs b/src/Sonarr.Api.V5/Queue/QueueController.cs index f3c946363..4fe384345 100644 --- a/src/Sonarr.Api.V5/Queue/QueueController.cs +++ b/src/Sonarr.Api.V5/Queue/QueueController.cs @@ -135,7 +135,7 @@ namespace Sonarr.Api.V5.Queue [HttpGet] [Produces("application/json")] - public PagingResource GetQueue([FromQuery] PagingRequestResource paging, bool includeUnknownSeriesItems = false, [FromQuery] int[]? seriesIds = null, DownloadProtocol? protocol = null, [FromQuery] int[]? languages = null, [FromQuery] int[]? quality = null, [FromQuery] QueueStatus[]? status = null, [FromQuery] QueueSubresource[]? includeSubresources = null) + public PagingResource GetQueue([FromQuery] PagingRequestResource paging, bool includeUnknownSeriesItems = true, [FromQuery] int[]? seriesIds = null, DownloadProtocol? protocol = null, [FromQuery] int[]? languages = null, [FromQuery] int[]? quality = null, [FromQuery] QueueStatus[]? status = null, [FromQuery] QueueSubresource[]? includeSubresources = null) { var pagingResource = new PagingResource(paging); var pagingSpec = pagingResource.MapToPagingSpec(