Manage Albums and Artists
The CreateDeleteController
handles the creation and deletion of albums and artists. These are
used primarily for if the scanner produces too many albums or no album due to an issue with track metadata.
Controller Route: /api/
All routes within the CreateDeleteController
are prefixed by /api/
.
Summary of Endpoints
Endpoint | Method | Description | Authorization |
---|---|---|---|
/api/album/create |
POST | Creates a new album. | Admin |
/api/album/delete |
POST | Deletes an existing album. | Admin |
/api/artist/create |
POST | Creates a new artist. | Admin |
/api/artist/delete |
POST | Deletes an existing artist. | Admin |
Create Album
Creates a new album.
Details:
- Endpoint:
/api/album/create
- Method:
POST
- Authorization: JWT with Admin role
Parameters:
- name (string, required): The name of the album.
Responses:
- 200 OK: Returns the unique identifier of the newly created album.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X POST "https://your-melon-server.com/api/album/create" \
-H "Authorization: Bearer <Admin-JWT>" \
-d "name=New Album"
Delete Album
Deletes an album by its unique identifier.
Details:
- Endpoint:
/api/album/delete
- Method:
POST
- Authorization: JWT with Admin role
Parameters:
- id (string, required): The unique identifier of the album to delete.
Responses:
- 200 OK: Album deleted successfully.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Album not found.
Example Request (using curl
):
curl -X POST "https://your-melon-server.com/api/album/delete" \
-H "Authorization: Bearer <Admin-JWT>" \
-d "id=612a29ff4f1a2d6f1c1b77aa"
Create Artist
Creates a new artist.
Details:
- Endpoint:
/api/artist/create
- Method:
POST
- Authorization: JWT with Admin role
Parameters:
- name (string, required): The name of the artist.
Responses:
- 200 OK: Returns the unique identifier of the newly created artist.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X POST "https://your-melon-server.com/api/artist/create" \
-H "Authorization: Bearer <Admin-JWT>" \
-d "name=New Artist"
Delete Artist
Deletes an artist by its unique identifier.
Details:
- Endpoint:
/api/artist/delete
- Method:
POST
- Authorization: JWT with Admin role
Parameters:
- id (string, required): The unique identifier of the artist to delete.
Responses:
- 200 OK: Artist deleted successfully.
- 401 Unauthorized: User lacks necessary permissions.
- 404 Not Found: Artist not found.
Example Request (using curl
):
curl -X POST "https://your-melon-server.com/api/artist/delete" \
-H "Authorization: Bearer <Admin-JWT>" \
-d "id=612a2f394f1a2d6f1c1b77ab"
Notes:
- All operations in this controller require Admin-level permissions.
- When deleting albums or artists, their associated tracks and other relevant data are updated accordingly.