albums
backend.api.albums
Section titled “backend.api.albums”albums api endpoints.
Functions
Section titled “Functions”invalidate_album_cache source
Section titled “invalidate_album_cache source”invalidate_album_cache(handle: str, slug: str) -> Nonedelete cached album response. fails silently.
invalidate_album_cache_by_id source
Section titled “invalidate_album_cache_by_id source”invalidate_album_cache_by_id(db: AsyncSession, album_id: str) -> Nonelook up album handle+slug and invalidate cache. fails silently.
list_albums source
Section titled “list_albums source”list_albums(db: Annotated[AsyncSession, Depends(get_db)]) -> dict[str, list[AlbumListItem]]list all albums with basic metadata.
list_artist_albums source
Section titled “list_artist_albums source”list_artist_albums(handle: str, db: Annotated[AsyncSession, Depends(get_db)]) -> dict[str, list[ArtistAlbumListItem]]list albums for a specific artist.
get_album source
Section titled “get_album source”get_album(handle: str, slug: str, db: Annotated[AsyncSession, Depends(get_db)], session: AuthSession | None = Depends(get_optional_session)) -> AlbumResponseget album details with tracks (ordered by ATProto list record or created_at).
upload_album_cover source
Section titled “upload_album_cover source”upload_album_cover(album_id: str, db: Annotated[AsyncSession, Depends(get_db)], auth_session: Annotated[AuthSession, Depends(require_artist_profile)], image: UploadFile = File(...)) -> dict[str, str | None]upload cover art for an album (requires authentication).
update_album source
Section titled “update_album source”update_album(album_id: str, db: Annotated[AsyncSession, Depends(get_db)], auth_session: Annotated[AuthSession, Depends(require_artist_profile)], title: Annotated[str | None, Query(description='new album title')] = None, description: Annotated[str | None, Query(description='new album description')] = None) -> AlbumMetadataupdate album metadata (title, description). syncs ATProto records on title change.
remove_track_from_album source
Section titled “remove_track_from_album source”remove_track_from_album(album_id: str, track_id: int, db: Annotated[AsyncSession, Depends(get_db)], auth_session: Annotated[AuthSession, Depends(require_artist_profile)]) -> RemoveTrackFromAlbumResponseremove a track from an album (orphan it, don’t delete).
the track remains available as a standalone track.
delete_album source
Section titled “delete_album source”delete_album(album_id: str, db: Annotated[AsyncSession, Depends(get_db)], auth_session: Annotated[AuthSession, Depends(require_artist_profile)], cascade: Annotated[bool, Query(description='if true, also delete all tracks in the album')] = False) -> DeleteAlbumResponsedelete album. tracks are orphaned unless cascade=true. removes ATProto list record.
Classes
Section titled “Classes”AlbumMetadata source
Section titled “AlbumMetadata source”album metadata response.
AlbumResponse source
Section titled “AlbumResponse source”album detail response with tracks.
AlbumListItem source
Section titled “AlbumListItem source”minimal album info for listing.
RemoveTrackFromAlbumResponse source
Section titled “RemoveTrackFromAlbumResponse source”response for removing a track from an album.
DeleteAlbumResponse source
Section titled “DeleteAlbumResponse source”response for deleting an album.
ArtistAlbumListItem source
Section titled “ArtistAlbumListItem source”album info for a specific artist (used on artist pages).