sort: Allow adding of comma seperated tags

This commit is contained in:
fleaz 2023-02-24 00:03:58 +01:00
parent 590590c8e5
commit d9a1f637f8
No known key found for this signature in database
GPG key ID: AED15F8FDD04D083

View file

@ -36,10 +36,11 @@ def command():
print("Skipping") print("Skipping")
continue continue
tag = tag_lookup.get(select, None) for text in select.split(","):
tag = tag_lookup.get(text, None)
if not tag: if not tag:
print(f"Creating new category '{select}'") print(f"Creating new category '{text}'")
tag = create_tag(select, session) tag = create_tag(text, session)
tags = session.query(Tag).all() tags = session.query(Tag).all()
tag_names = FuzzyWordCompleter([x.name for x in tags]) tag_names = FuzzyWordCompleter([x.name for x in tags])
@ -47,6 +48,7 @@ def command():
t.tags.append(tag) t.tags.append(tag)
session.add(t) session.add(t)
session.commit() session.commit()
print("-" * 20) print("-" * 20)