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:
+7
-5
@@ -602,8 +602,11 @@ def artist_list():
|
|||||||
|
|
||||||
@main.route('/artist/<artist_name>')
|
@main.route('/artist/<artist_name>')
|
||||||
def artist_gallery(artist_name):
|
def artist_gallery(artist_name):
|
||||||
# Backward-compatible: go to gallery filtered by artist tag
|
# Backward-compatible: resolve artist to its tag id and redirect to the id-keyed gallery URL.
|
||||||
return redirect(url_for('main.gallery', tag=f"artist:{artist_name}"))
|
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')
|
@main.route('/settings')
|
||||||
@@ -2038,10 +2041,9 @@ def reapply_artist_tags_from_paths():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# Create or get the artist tag
|
# Create or get the artist tag
|
||||||
tag_name = f"artist:{artist_name}"
|
tag = Tag.query.filter_by(kind='artist', name=artist_name).first()
|
||||||
tag = Tag.query.filter_by(name=tag_name).first()
|
|
||||||
if not tag:
|
if not tag:
|
||||||
tag = Tag(name=tag_name, kind='artist')
|
tag = Tag(kind='artist', name=artist_name)
|
||||||
db.session.add(tag)
|
db.session.add(tag)
|
||||||
db.session.flush()
|
db.session.flush()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user