Skip to content

Commit

Permalink
fix category selection
Browse files Browse the repository at this point in the history
  • Loading branch information
soad003 committed Feb 28, 2023
1 parent 63a868e commit dc453a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build
.DS_Store
data
docker-compose.override.yml
tagpack-repos.config
tagpack-repos*.config

# Temporary and binary files
*~
Expand Down
3 changes: 2 additions & 1 deletion src/tagpack/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,10 @@ def get_label(actor_row):

return [(x["id"], get_label(x)) for x in res]

category_filter = strip_empty(args.only_categories.split(","))
updated = tagpack.add_actors(
find_actor_candidates,
only_categories=strip_empty(args.only_categories.split(",")),
only_categories=category_filter if len(category_filter) > 0 else None,
user_choice_cache=user_choice_cache,
)

Expand Down
4 changes: 2 additions & 2 deletions src/tagpack/tagpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ def get_user_choice_cached(hl, cache):
"label" in self.all_header_fields
and "actor" not in self.all_header_fields
and (
only_categories is not None
and self.all_header_fields.get("category") in only_categories
only_categories is None
or self.all_header_fields.get("category", "") in only_categories
)
):
hl = self.all_header_fields.get("label")
Expand Down

0 comments on commit dc453a7

Please sign in to comment.