From 19e1b09f2c50b6726e87307fdec8705cbe4d7ed8 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 22 Apr 2026 16:20:53 -0400 Subject: [PATCH] chore: final fixes from post-refactor smoke test artist_gallery redirect and reapply_artist_tags_from_paths both still built f"artist:{name}" strings. Last stragglers cleaned up; the dead-code sweep now returns zero prefix-construction hits. Co-Authored-By: Claude Opus 4.7 --- app/main.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/main.py b/app/main.py index a9087c9..dc4b5d0 100644 --- a/app/main.py +++ b/app/main.py @@ -602,8 +602,11 @@ def artist_list(): @main.route('/artist/') def artist_gallery(artist_name): - # Backward-compatible: go to gallery filtered by artist tag - return redirect(url_for('main.gallery', tag=f"artist:{artist_name}")) + # Backward-compatible: resolve artist to its tag id and redirect to the id-keyed gallery URL. + tag = Tag.query.filter_by(kind='artist', name=artist_name).first() + if tag is None: + return redirect(url_for('main.tag_list', kind='artist')) + return redirect(url_for('main.gallery', tag_id=tag.id)) @main.route('/settings') @@ -2038,10 +2041,9 @@ def reapply_artist_tags_from_paths(): continue # Create or get the artist tag - tag_name = f"artist:{artist_name}" - tag = Tag.query.filter_by(name=tag_name).first() + tag = Tag.query.filter_by(kind='artist', name=artist_name).first() if not tag: - tag = Tag(name=tag_name, kind='artist') + tag = Tag(kind='artist', name=artist_name) db.session.add(tag) db.session.flush()