fix: update condition type filtering to show all options

This commit is contained in:
Sam Chau
2026-01-19 10:40:58 +10:30
parent 487b043278
commit 78c7cc19a2
3 changed files with 17 additions and 21 deletions

View File

@@ -30,7 +30,7 @@ export const SOURCE_VALUES = [
{ value: 'unknown', label: 'Unknown', arrType: 'all' as ArrType },
{ value: 'television', label: 'Television', arrType: 'all' as ArrType },
{ value: 'television_raw', label: 'Television Raw', arrType: 'sonarr' as ArrType },
{ value: 'webdl', label: 'WEB-DL', arrType: 'all' as ArrType },
{ value: 'web_dl', label: 'WEB-DL', arrType: 'all' as ArrType },
{ value: 'webrip', label: 'WEBRip', arrType: 'all' as ArrType },
{ value: 'dvd', label: 'DVD', arrType: 'all' as ArrType },
{ value: 'bluray', label: 'Bluray', arrType: 'all' as ArrType },

View File

@@ -52,26 +52,24 @@
return 'all'; // Default to 'all' if neither is checked
}
// Filter condition types based on arrType
$: filteredConditionTypes = CONDITION_TYPES.filter(
(t) => t.arrType === 'all' || t.arrType === arrType
);
// All condition types (no arrType filtering)
$: filteredConditionTypes = [...CONDITION_TYPES];
// Get value options based on current type
// Get value options based on current type (no arrType filtering - show all options)
$: valueOptions = getValueOptions(condition.type);
function getValueOptions(type: string) {
switch (type) {
case 'source':
return SOURCE_VALUES.filter((v) => v.arrType === 'all' || v.arrType === arrType);
return [...SOURCE_VALUES];
case 'resolution':
return RESOLUTION_VALUES.filter((v) => v.arrType === 'all' || v.arrType === arrType);
return [...RESOLUTION_VALUES];
case 'quality_modifier':
return QUALITY_MODIFIER_VALUES.filter((v) => v.arrType === 'all' || v.arrType === arrType);
return [...QUALITY_MODIFIER_VALUES];
case 'release_type':
return RELEASE_TYPE_VALUES.filter((v) => v.arrType === 'all' || v.arrType === arrType);
return [...RELEASE_TYPE_VALUES];
case 'indexer_flag':
return INDEXER_FLAG_VALUES.filter((v) => v.arrType === 'all' || v.arrType === arrType);
return [...INDEXER_FLAG_VALUES];
default:
return [];
}

View File

@@ -47,26 +47,24 @@
return 'all'; // Default to 'all' if neither is checked
}
// Filter condition types based on arrType
$: filteredConditionTypes = CONDITION_TYPES.filter(
(t) => t.arrType === 'all' || t.arrType === arrType
);
// All condition types (no arrType filtering)
$: filteredConditionTypes = [...CONDITION_TYPES];
// Get value options based on current type
// Get value options based on current type (no arrType filtering - show all options)
$: valueOptions = getValueOptions(condition.type);
function getValueOptions(type: string) {
switch (type) {
case 'source':
return SOURCE_VALUES.filter((v) => v.arrType === 'all' || v.arrType === arrType);
return [...SOURCE_VALUES];
case 'resolution':
return RESOLUTION_VALUES.filter((v) => v.arrType === 'all' || v.arrType === arrType);
return [...RESOLUTION_VALUES];
case 'quality_modifier':
return QUALITY_MODIFIER_VALUES.filter((v) => v.arrType === 'all' || v.arrType === arrType);
return [...QUALITY_MODIFIER_VALUES];
case 'release_type':
return RELEASE_TYPE_VALUES.filter((v) => v.arrType === 'all' || v.arrType === arrType);
return [...RELEASE_TYPE_VALUES];
case 'indexer_flag':
return INDEXER_FLAG_VALUES.filter((v) => v.arrType === 'all' || v.arrType === arrType);
return [...INDEXER_FLAG_VALUES];
default:
return [];
}