uploads
backend.api.tracks.uploads
Section titled “backend.api.tracks.uploads”Track upload endpoints and background processing.
Functions
Section titled “Functions”upload_track source
Section titled “upload_track source”upload_track(request: Request, title: Annotated[str, Form()], background_tasks: BackgroundTasks, auth_session: AuthSession = Depends(require_artist_profile), album: Annotated[str | None, Form()] = None, features: Annotated[str | None, Form()] = None, tags: Annotated[str | None, Form(description='JSON array of tag names')] = None, support_gate: Annotated[str | None, Form(description='JSON object for supporter gating, e.g., {"type": "any"}')] = None, description: Annotated[str | None, Form(description='Track description (liner notes, show notes, etc.)')] = None, auto_tag: Annotated[str | None, Form(description='auto-apply recommended genre tags after classification')] = None, file: UploadFile = File(...), image: UploadFile | None = File(None)) -> UploadStartResponseUpload a new track (requires authentication and artist profile).
Args:
title: Track title (required).album: Optional album name/ID to associate with the track.features: Optional JSON array of ATProto handles, e.g., [“user1.bsky.social”, “user2.bsky.social”].support_gate: Optional JSON object for supporter gating. Requires atprotofans to be enabled in settings. Example: {“type”: “any”} - requires any atprotofans support.file: Audio file to upload (required).image: Optional image file for track artwork. Accepted formats: JPG, PNG, WebP, GIF. Max 20 MB. Square images (1:1) recommended — non-square images are center-cropped.background_tasks: FastAPI background-task runner.auth_session: Authenticated artist session (dependency-injected).
Returns:
- A payload containing
upload_idfor monitoring progress via SSE.
upload_progress source
Section titled “upload_progress source”upload_progress(upload_id: str) -> StreamingResponseSSE endpoint for real-time upload progress.
Classes
Section titled “Classes”UploadStartResponse source
Section titled “UploadStartResponse source”response when upload is queued for processing.
UploadContext source
Section titled “UploadContext source”all data needed to process an upload in the background.
AudioInfo source
Section titled “AudioInfo source”result of audio validation phase.
StorageResult source
Section titled “StorageResult source”result of audio storage phase.
UploadPhaseError source
Section titled “UploadPhaseError source”raised when an upload phase fails with a user-facing message.
TranscodeInfo source
Section titled “TranscodeInfo source”result of transcoding an audio file.
PdsBlobResult source
Section titled “PdsBlobResult source”result of attempting to upload a blob to user’s PDS.