Fix exclude option

This commit is contained in:
Cédric Leporcq 2022-04-18 19:38:41 +02:00
parent acf1619b7a
commit b883d9ca36
3 changed files with 11 additions and 3 deletions

View File

@ -348,6 +348,7 @@ def _compare(**kwargs):
@cli.command('edit') @cli.command('edit')
@add_options(_logger_options) @add_options(_logger_options)
@add_options(_exclude_options)
@add_options(_filter_options) @add_options(_filter_options)
@click.option( @click.option(
'--key', '--key',

View File

@ -732,9 +732,16 @@ class Collection(SortMedias):
# Set client options # Set client options
for option, value in cli_options.items(): for option, value in cli_options.items():
if value not in (None, ()): if value not in (None, set()):
for section in self.opt: for section in self.opt:
self.opt[section][option] = value if option in self.opt[section]:
if option == 'exclude':
self.opt[section][option].union(set(value))
elif option in ('ignore_tags', 'extensions'):
self.opt[section][option] = set(value)
else:
self.opt[section][option] = value
break
self.exclude = self.opt['Filters']['exclude'] self.exclude = self.opt['Filters']['exclude']
if not self.exclude: if not self.exclude:

View File

@ -66,7 +66,7 @@ class Config:
'use_file_dates': False, 'use_file_dates': False,
}, },
'Filters': { 'Filters': {
'exclude': None, 'exclude': set(),
'extensions': None, 'extensions': None,
'glob': '**/*', 'glob': '**/*',
'max_deep': None, 'max_deep': None,