diff --git a/app/main.py b/app/main.py index 4d5278d..4b04799 100644 --- a/app/main.py +++ b/app/main.py @@ -26,15 +26,14 @@ def _parse_character_fandom(name_after_prefix): def _ensure_fandom_tag(fandom_name): - """Find or create a fandom tag by name. Returns the Tag object. + """Find or create a fandom tag by bare name. Returns the Tag object. Normalizes the display name so callers don't have to remember. """ normalized = normalize_display_name(fandom_name.strip()) - full_name = f"fandom:{normalized}" - fandom_tag = Tag.query.filter_by(name=full_name).first() + fandom_tag = Tag.query.filter_by(kind='fandom', name=normalized).first() if not fandom_tag: - fandom_tag = Tag(name=full_name, kind="fandom") + fandom_tag = Tag(kind='fandom', name=normalized) db.session.add(fandom_tag) db.session.flush() return fandom_tag