+3
-5
backend/src/backend/api/tracks/tags.py
+3
-5
backend/src/backend/api/tracks/tags.py
···
14
14
from backend.schemas import TrackResponse
15
15
from backend.utilities.aggregations import (
16
16
get_comment_counts,
17
17
-
get_copyright_info,
18
17
get_like_counts,
19
18
get_track_tags,
20
19
)
···
82
81
)
83
82
liked_track_ids = set(liked_result.scalars().all())
84
83
85
85
-
# batch fetch like, comment counts, copyright info, and tags
84
84
+
# batch fetch like counts, comment counts, and tags
85
85
+
# note: copyright_info excluded - only needed in artist portal (/tracks/me)
86
86
track_ids = [track.id for track in tracks]
87
87
-
like_counts, comment_counts, copyright_info, track_tags_map = await asyncio.gather(
87
87
+
like_counts, comment_counts, track_tags_map = await asyncio.gather(
88
88
get_like_counts(db, track_ids),
89
89
get_comment_counts(db, track_ids),
90
90
-
get_copyright_info(db, track_ids),
91
90
get_track_tags(db, track_ids),
92
91
)
93
92
···
99
98
liked_track_ids=liked_track_ids,
100
99
like_counts=like_counts,
101
100
comment_counts=comment_counts,
102
102
-
copyright_info=copyright_info,
103
101
track_tags=track_tags_map,
104
102
)
105
103
for track in tracks