diff --git a/backend/app/api/tags.py b/backend/app/api/tags.py index 97e5e30..ec9990a 100644 --- a/backend/app/api/tags.py +++ b/backend/app/api/tags.py @@ -127,15 +127,15 @@ async def tag_stats(tag_id: int): tag = await session.get(Tag, tag_id) if tag is None: return jsonify({"error": "not found"}), 404 - by_source = { - src: n for src, n in ( + by_source = dict( + ( await session.execute( select(image_tag.c.source, func.count()) .where(image_tag.c.tag_id == tag_id) .group_by(image_tag.c.source) ) ).all() - } + ) rejected = ( await session.execute( select(func.count())