Art Deletion Controller Documentation
The ArtDeleteController
handles deleting artwork associated with various entities such as
tracks, artists, playlists, collections, and default artwork.
For more details on how Melon manages artwork, refer to the Artwork Architecture.
Controller Route: /api/art/delete
All routes within the ArtDeleteController
are prefixed by /api/art/delete
.
Summary of Endpoints
Endpoint | Method | Description | Authorization |
---|---|---|---|
/api/art/delete/track-art |
POST | Deletes the artwork associated with a specific track. | Admin |
/api/art/delete/artist-pfp |
POST | Deletes the profile picture of a specific artist. | Admin |
/api/art/delete/artist-banner |
POST | Deletes the banner artwork of a specific artist. | Admin |
/api/art/delete/playlist-art |
POST | Deletes the artwork associated with a specific playlist. | Admin |
/api/art/delete/collection-art |
POST | Deletes the artwork associated with a specific collection. | Admin |
/api/art/delete/default-art |
POST | Deletes the default custom artwork. | Admin |
Delete Track Artwork
Deletes the artwork associated with a specific track at a specified position.
Details:
- Endpoint:
/api/art/delete/track-art
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
application/x-www-form-urlencoded
Parameters:
- id (string, required): The unique identifier of the track.
- pos (int, required): The position of the artwork to be deleted (starting at 0).
Responses:
- 200 OK: Artwork deleted successfully.
- 400 Bad Request: Invalid input parameters (e.g., invalid position).
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Track or track file not found.
Example Request (using curl
):
curl -X POST "https://your-melon-server.com/api/art/delete/track-art" \
-H "Authorization: Bearer <Admin-JWT>" \
-d "id=track123&pos=1"
Delete Artist Profile Picture
Deletes the profile picture of a specified artist at a given position.
Details:
- Endpoint:
/api/art/delete/artist-pfp
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
application/x-www-form-urlencoded
Parameters:
- id (string, required): The unique identifier of the artist.
- pos (int, required): The position of the profile picture to be deleted (starting at 0).
Responses:
- 200 OK: Profile picture deleted successfully.
- 400 Bad Request: Invalid input parameters (e.g., invalid position).
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Artist or profile picture not found.
Example Request (using curl
):
curl -X POST "https://your-melon-server.com/api/art/delete/artist-pfp" \
-H "Authorization: Bearer <Admin-JWT>" \
-d "id=artist456&pos=0"
Delete Artist Banner
Deletes the banner artwork associated with a specified artist at a given position.
Details:
- Endpoint:
/api/art/delete/artist-banner
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
application/x-www-form-urlencoded
Parameters:
- id (string, required): The unique identifier of the artist.
- pos (int, required): The position of the banner artwork to be deleted (starting at 0).
Responses:
- 200 OK: Banner artwork deleted successfully.
- 400 Bad Request: Invalid input parameters (e.g., invalid position).
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Artist or banner not found.
Example Request (using curl
):
curl -X POST "https://your-melon-server.com/api/art/delete/artist-banner" \
-H "Authorization: Bearer <Admin-JWT>" \
-d "id=artist456&pos=1"
Delete Playlist Artwork
Deletes the artwork associated with a specified playlist.
Details:
- Endpoint:
/api/art/delete/playlist-art
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
application/x-www-form-urlencoded
Parameters:
- id (string, required): The unique identifier of the playlist.
Responses:
- 200 OK: Playlist artwork deleted successfully.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Playlist or artwork not found.
Example Request (using curl
):
curl -X POST "https://your-melon-server.com/api/art/delete/playlist-art" \
-H "Authorization: Bearer <Admin-JWT>" \
-d "id=playlist789"
Delete Collection Artwork
Deletes the artwork associated with a specified collection.
Details:
- Endpoint:
/api/art/delete/collection-art
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
application/x-www-form-urlencoded
Parameters:
- id (string, required): The unique identifier of the collection.
Responses:
- 200 OK: Collection artwork deleted successfully.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Collection or artwork not found.
Example Request (using curl
):
curl -X POST "https://your-melon-server.com/api/art/delete/collection-art" \
-H "Authorization: Bearer <Admin-JWT>" \
-d "id=collection123"
Delete Default Artwork
Deletes the custom default artwork used when no specific artwork is set.
Details:
- Endpoint:
/api/art/delete/default-art
- Method:
POST
- Authorization: JWT with Admin role
- Consumes:
application/x-www-form-urlencoded
Parameters: None
Responses:
- 200 OK: Default artwork deleted successfully.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Default artwork file not found.
Example Request (using curl
):
curl -X POST "https://your-melon-server.com/api/art/delete/default-art" \
-H "Authorization: Bearer <Admin-JWT>"