tags
backend.api.tracks.tags
Section titled “backend.api.tracks.tags”tag endpoints for track categorization.
Functions
Section titled “Functions”get_tracks_by_tag source
Section titled “get_tracks_by_tag source”get_tracks_by_tag(tag_name: str, db: Annotated[AsyncSession, Depends(get_db)], session: AuthSession | None = Depends(get_optional_session)) -> TagTracksResponseget all tracks with a specific tag.
returns tag info and list of tracks tagged with that tag.
list_tags source
Section titled “list_tags source”list_tags(db: Annotated[AsyncSession, Depends(get_db)], q: Annotated[str | None, Query(description='search query for tag names')] = None, limit: Annotated[int, Query(ge=1, le=100)] = 20) -> list[TagWithCount]list tags with track counts, optionally filtered by query.
returns tags sorted by track count (most used first).
use q parameter for prefix search (case-insensitive).
get_recommended_tags source
Section titled “get_recommended_tags source”get_recommended_tags(track_id: int, db: Annotated[AsyncSession, Depends(get_db)], limit: Annotated[int, Query(ge=1, le=20)] = 5) -> RecommendedTagsResponserecommend tags for a track based on ML genre classification.
uses effnet-discogs via Replicate to classify audio into genre labels. results are cached in track.extra[“genre_predictions”].
Classes
Section titled “Classes”TagWithCount source
Section titled “TagWithCount source”tag with track count for autocomplete.
TagDetail source
Section titled “TagDetail source”tag detail with metadata.
TagTracksResponse source
Section titled “TagTracksResponse source”response for getting tracks by tag.
RecommendedTag source
Section titled “RecommendedTag source”a recommended tag with confidence score.
RecommendedTagsResponse source
Section titled “RecommendedTagsResponse source”response for tag recommendations based on genre classification.