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 <noreply@anthropic.com>
This commit is contained in:
2026-04-22 16:20:53 -04:00
parent 27609043e8
commit 19e1b09f2c
+7 -5
View File
@@ -602,8 +602,11 @@ def artist_list():
@main.route('/artist/<artist_name>')
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()