mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
enhancement(filters): exclude tags_match_logic
on export if default value (#908)
ignore tags_match_logic on export if default value
This commit is contained in:
parent
282175c39f
commit
537bbe3394
1 changed files with 4 additions and 2 deletions
|
@ -391,14 +391,16 @@ const FilterItemDropdown = ({ filter, onToggle }: FilterItemDropdownProps) => {
|
||||||
delete completeFilter.external_webhook_expect_status;
|
delete completeFilter.external_webhook_expect_status;
|
||||||
|
|
||||||
// Remove properties with default values from the exported filter to minimize the size of the JSON string
|
// Remove properties with default values from the exported filter to minimize the size of the JSON string
|
||||||
["enabled", "priority", "smart_episode", "resolutions", "sources", "codecs", "containers"].forEach((key) => {
|
["enabled", "priority", "smart_episode", "resolutions", "sources", "codecs", "containers", "tags_match_logic", "except_tags_match_logic"].forEach((key) => {
|
||||||
const value = completeFilter[key as keyof CompleteFilterType];
|
const value = completeFilter[key as keyof CompleteFilterType];
|
||||||
if (["enabled", "priority", "smart_episode"].includes(key) && (value === false || value === 0)) {
|
if (["enabled", "priority", "smart_episode"].includes(key) && (value === false || value === 0)) {
|
||||||
delete completeFilter[key as keyof CompleteFilterType];
|
delete completeFilter[key as keyof CompleteFilterType];
|
||||||
} else if (["resolutions", "sources", "codecs", "containers"].includes(key) && Array.isArray(value) && value.length === 0) {
|
} else if (["resolutions", "sources", "codecs", "containers"].includes(key) && Array.isArray(value) && value.length === 0) {
|
||||||
delete completeFilter[key as keyof CompleteFilterType];
|
delete completeFilter[key as keyof CompleteFilterType];
|
||||||
|
} else if (["tags_match_logic", "except_tags_match_logic"].includes(key) && value === "ANY") {
|
||||||
|
delete completeFilter[key as keyof CompleteFilterType];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create a JSON string from the filter data, including a name and version
|
// Create a JSON string from the filter data, including a name and version
|
||||||
const json = JSON.stringify(
|
const json = JSON.stringify(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue