update condition to sync specific projects

This commit is contained in:
Michael 2023-05-03 12:40:32 +03:00 committed by GitHub
parent 6e9b6f6bef
commit ad4f5876ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -389,16 +389,18 @@ def sync_all_projects(login: str, password: str, ignore_projects: list = None,
# listen only
return
if filter_projects == ['*']:
if '*' in filter_projects:
# all projects
project_to_sync = all_projects
all_kitsu_projects = {p['name']: p for p in all_projects}
for proj_name in filter_projects:
if proj_name in all_kitsu_projects:
project_to_sync.append(all_kitsu_projects[proj_name])
else:
log.info(f'`{proj_name}` project does not exist in Kitsu.'
f' Please make sure the project is spelled correctly.')
else:
all_kitsu_projects = {p['name']: p for p in all_projects}
for proj_name in filter_projects:
if proj_name in all_kitsu_projects:
project_to_sync.append(all_kitsu_projects[proj_name])
else:
log.info(f'`{proj_name}` project does not exist in Kitsu.'
f' Please make sure the project is spelled correctly.')
for project in project_to_sync:
if ignore_projects and project["name"] in ignore_projects: