artists
backend.api.artists
Section titled “backend.api.artists”artist profile API endpoints.
Functions
Section titled “Functions”create_artist source
Section titled “create_artist source”create_artist(request: CreateArtistRequest, db: Annotated[AsyncSession, Depends(get_db)], auth_session: Session = Depends(require_auth)) -> ArtistResponsecreate or update artist profile for authenticated user.
if a minimal Artist record was created during OAuth login, this updates it with the user’s profile setup choices. otherwise creates a new record.
get_my_artist_profile source
Section titled “get_my_artist_profile source”get_my_artist_profile(db: Annotated[AsyncSession, Depends(get_db)], auth_session: Session = Depends(require_auth)) -> ArtistResponseget authenticated user’s artist profile.
update_my_artist_profile source
Section titled “update_my_artist_profile source”update_my_artist_profile(request: UpdateArtistRequest, db: Annotated[AsyncSession, Depends(get_db)], auth_session: Session = Depends(require_auth)) -> ArtistResponseupdate authenticated user’s artist profile.
get_artists_batch source
Section titled “get_artists_batch source”get_artists_batch(dids: list[str], db: Annotated[AsyncSession, Depends(get_db)]) -> dict[str, ArtistResponse]get artist profiles for multiple DIDs (public endpoint).
returns a dict mapping DID -> artist data for any DIDs that exist in our database. DIDs not found are simply omitted from the response.
get_artist_profile_by_handle source
Section titled “get_artist_profile_by_handle source”get_artist_profile_by_handle(handle: str, db: Annotated[AsyncSession, Depends(get_db)]) -> ArtistResponseget artist profile by handle (public endpoint).
get_artist_profile_by_did source
Section titled “get_artist_profile_by_did source”get_artist_profile_by_did(did: str, db: Annotated[AsyncSession, Depends(get_db)]) -> ArtistResponseget artist profile by DID (public endpoint).
get_artist_analytics source
Section titled “get_artist_analytics source”get_artist_analytics(artist_did: str, db: Annotated[AsyncSession, Depends(get_db)]) -> AnalyticsResponseget public analytics for any artist by DID.
returns zeros if artist has no tracks.
get_my_analytics source
Section titled “get_my_analytics source”get_my_analytics(db: Annotated[AsyncSession, Depends(get_db)], auth_session: Session = Depends(require_auth)) -> AnalyticsResponseget analytics for authenticated artist.
returns zeros if artist has no tracks - no need to verify artist exists.
refresh_artist_avatar source
Section titled “refresh_artist_avatar source”refresh_artist_avatar(did: str, db: Annotated[AsyncSession, Depends(get_db)]) -> RefreshAvatarResponserefresh an artist’s avatar from Bluesky (public endpoint).
called when the frontend detects a stale/broken avatar URL (404). fetches the current avatar from Bluesky and updates the database.
Classes
Section titled “Classes”CreateArtistRequest source
Section titled “CreateArtistRequest source”request to create artist profile.
UpdateArtistRequest source
Section titled “UpdateArtistRequest source”request to update artist profile.
ArtistResponse source
Section titled “ArtistResponse source”artist profile response.
Methods:
normalize_avatar source
Section titled “normalize_avatar source”normalize_avatar(cls, v: str | None) -> str | Nonenormalize avatar URL to use Bluesky CDN.
TopItemResponse source
Section titled “TopItemResponse source”top item in analytics.
AnalyticsResponse source
Section titled “AnalyticsResponse source”analytics data for artist.
RefreshAvatarResponse source
Section titled “RefreshAvatarResponse source”response from avatar refresh.