Art Upload Controller Documentation
The ArtUploadController
provides endpoints for uploading various types of artwork in into Melon.
Artwork can be uploaded for tracks, artists, albums, playlists, collections, and a custom default image.
For more details on how Melon manages artwork, refer to the Artwork Architecture.
Controller Route: /api/art/upload
All routes within the ArtUploadController
are prefixed by /api/art/upload
.
Summary of Endpoints
Endpoint | Method | Description | Authorization |
---|---|---|---|
/api/art/upload/track-art |
POST | Uploads artwork for a specific track. | Admin |
/api/art/upload/artist-pfp |
POST | Uploads a profile picture for a specific artist. | Admin |
/api/art/upload/artist-banner |
POST | Uploads a banner artwork for a specific artist. | Admin |
/api/art/upload/album-art |
POST | Uploads artwork for a specific album. | Admin |
/api/art/upload/playlist-art |
POST | Uploads artwork for a specific playlist. | Admin |
/api/art/upload/collection-art |
POST | Uploads artwork for a specific collection. | Admin |
/api/art/upload/default-art |
POST | Uploads the default artwork to replace the existing one. | Admin |
Upload Track Artwork
Uploads artwork for a specified track. The artwork is embedded into the track file.
Details:
- Endpoint:
/api/art/upload/track-art
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
multipart/form-data
Parameters:
- id (string, required): The unique identifier of the track.
- image (IFormFile, required): The artwork to be uploaded.
Responses:
- 200 OK: Artwork uploaded successfully.
- 400 Bad Request: Invalid input parameters.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Track or track file not found.
Example Request:
curl -X POST "https://your-melon-server.com/api/art/upload/track-art" \
-H "Authorization: Bearer <Admin-JWT>" \
-F "id=66bc9aadab7ba419497e6a97" \
-F "image=@/path/to/your/artwork.jpg"
Upload Artist Profile Picture
Uploads a profile picture for a specific artist.
Details:
- Endpoint:
/api/art/upload/artist-pfp
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
multipart/form-data
Parameters:
- id (string, required): The unique identifier of the artist.
- image (IFormFile, required): The artwork to be uploaded.
Responses:
- 200 OK: Profile picture uploaded successfully.
- 400 Bad Request: Invalid input parameters.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Artist not found.
Example Request:
curl -X POST "https://your-melon-server.com/api/art/upload/artist-pfp" \
-H "Authorization: Bearer <Admin-JWT>" \
-F "id=66bc9aadab7ba419497e6a97" \
-F "image=@/path/to/your/artwork.jpg"
Upload Artist Banner
Uploads a banner artwork for a specified artist.
Details:
- Endpoint:
/api/art/upload/artist-banner
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
multipart/form-data
Parameters:
- id (string, required): The unique identifier of the artist.
- image (IFormFile, required): The banner artwork to be uploaded.
Responses:
- 200 OK: Banner uploaded successfully.
- 400 Bad Request: Invalid input parameters.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Artist not found.
Example Request:
curl -X POST "https://your-melon-server.com/api/art/upload/artist-banner`" \
-H "Authorization: Bearer <Admin-JWT>" \
-F "id=66bc9aadab7ba419497e6a97" \
-F "image=@/path/to/your/artwork.jpg"
Upload Album Artwork
Uploads an artwork image for a specified album.
Details:
- Endpoint:
/api/art/upload/album-art
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
multipart/form-data
Parameters:
- id (string, required): The unique identifier of the album.
- image (IFormFile, required): The artwork to be uploaded.
Responses:
- 200 OK: Album artwork uploaded successfully.
- 400 Bad Request: Invalid input parameters.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Album not found.
Example Request:
curl -X POST "https://your-melon-server.com/api/art/upload/album-art`" \
-H "Authorization: Bearer <Admin-JWT>" \
-F "id=66bc9aadab7ba419497e6a97" \
-F "image=@/path/to/your/artwork.jpg"
Upload Playlist Artwork
Uploads an artwork image for a specified playlist, replacing any existing artwork.
Details:
- Endpoint:
/api/art/upload/playlist-art
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
multipart/form-data
Parameters:
- id (string, required): The unique identifier of the playlist.
- image (IFormFile, required): The artwork to be uploaded.
Responses:
- 200 OK: Playlist artwork uploaded successfully.
- 400 Bad Request: Invalid input parameters.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Playlist not found.
Example Request:
curl -X POST "https://your-melon-server.com/api/art/upload/playlist-art`" \
-H "Authorization: Bearer <Admin-JWT>" \
-F "id=66bc9aadab7ba419497e6a97" \
-F "image=@/path/to/your/artwork.jpg"
Upload Collection Artwork
Uploads an artwork image for a specified collection, replacing any existing artwork.
Details:
- Endpoint:
/api/art/upload/collection-art
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
multipart/form-data
Parameters:
- id (string, required): The unique identifier of the collection.
- image (IFormFile, required): The artwork to be uploaded.
Responses:
- 200 OK: Collection artwork uploaded successfully.
- 400 Bad Request: Invalid input parameters.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Collection not found.
Example Request:
curl -X POST "https://your-melon-server.com/api/art/upload/collection-art`" \
-H "Authorization: Bearer <Admin-JWT>" \
-F "id=66bc9aadab7ba419497e6a97" \
-F "image=@/path/to/your/artwork.jpg"
Upload Default Artwork
Uploads the default artwork that is used when no other artwork is available.
Details:
- Endpoint:
/api/art/upload/default-art
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
multipart/form-data
Parameters:
- image (IFormFile, required): The default artwork to be uploaded.
Responses:
- 200 OK: Default artwork uploaded successfully.
- 400 Bad Request: Invalid input parameters.
- 401 Unauthorized: User lacks necessary permissions.
Example Request:
curl -X POST "https://your-melon-server.com/api/art/upload/default-art`" \
-H "Authorization: Bearer <Admin-JWT>" \
-F "id=66bc9aadab7ba419497e6a97" \
-F "image=@/path/to/your/artwork.jpg"