Database Controller Documentation
The DatabaseController
provides various endpoints for retrieving metadata about the tracks and
albums stored in the Melon server's database. This includes retrieving formats, bitrates, sample rates,
and more.
Controller Route: /api/db/
All routes within the DatabaseController
are prefixed by /api/db/
.
Summary of Endpoints
Endpoint | Method | Description | Authorization |
---|---|---|---|
/api/db/format |
GET | Retrieves a list of unique track formats. | Admin, User, Pass |
/api/db/bitrate |
GET | Retrieves a list of unique bitrates. | Admin, User, Pass |
/api/db/sample-rate |
GET | Retrieves a list of unique sample rates. | Admin, User, Pass |
/api/db/bits-per-sample |
GET | Retrieves a list of unique bit depths. | Admin, User, Pass |
/api/db/channel |
GET | Retrieves a list of unique channels. | Admin, User, Pass |
/api/db/release-status |
GET | Retrieves a list of album release statuses. | Admin, User, Pass |
/api/db/release-type |
GET | Retrieves a list of album release types. | Admin, User, Pass |
/api/db/publisher |
GET | Retrieves a list of unique publishers. | Admin, User, Pass |
/api/db/genres |
GET | Retrieves a list of unique genres. | Admin, User, Pass |
Get Track Formats
Retrieves a list of unique formats from the tracks in the database.
Details:
- Endpoint:
/api/db/format
- Method:
GET
- Authorization: JWT with Admin, User, or Pass role
Responses:
- 200 OK: A list of track formats is returned.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/db/format" \
-H "Authorization: Bearer <User-JWT>"
Get Track Bitrates
Retrieves a list of unique bitrates from the tracks in the database.
Details:
- Endpoint:
/api/db/bitrate
- Method:
GET
- Authorization: JWT with Admin, User, or Pass role
Responses:
- 200 OK: A list of bitrates is returned.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/db/Bitrates" \
-H "Authorization: Bearer <User-JWT>"
Get Track Sample Rates
Retrieves a list of unique sample rates from the tracks in the database.
Details:
- Endpoint:
/api/db/sample-rate
- Method:
GET
- Authorization: JWT with Admin, User, or Pass role
Responses:
- 200 OK: A list of sample rates is returned.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/db/sample-rate`" \
-H "Authorization: Bearer <User-JWT>"
Get Track Bits Per Sample
Retrieves a list of unique bit depths (bits per sample) from the tracks in the database.
Details:
- Endpoint:
/api/db/bits-per-sample
- Method:
GET
- Authorization: JWT with Admin, User, or Pass role
Responses:
- 200 OK: A list of bit depths is returned.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/db/bits-per-sample" \
-H "Authorization: Bearer <User-JWT>"
Get Track Channels
Retrieves a list of unique channel configurations (e.g., mono, stereo) from the tracks in the database.
Details:
- Endpoint:
/api/db/channel
- Method:
GET
- Authorization: JWT with Admin, User, or Pass role
Responses:
- 200 OK: A list of channels is returned.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/db/channel" \
-H "Authorization: Bearer <User-JWT>"
Get Album Release Statuses
Retrieves a list of unique album release statuses from the albums in the database (e.g., "Released", "Unreleased").
Details:
- Endpoint:
/api/db/release-status
- Method:
GET
- Authorization: JWT with Admin, User, or Pass role
Responses:
- 200 OK: A list of release statuses is returned.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/db/release-status" \
-H "Authorization: Bearer <User-JWT>"
Get Album Release Types
Retrieves a list of unique album release types from the albums in the database (e.g., "Album", "Single").
Details:
- Endpoint:
/api/db/release-type
- Method:
GET
- Authorization: JWT with Admin, User, or Pass role
Responses:
- 200 OK: A list of release types is returned.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/db/release-type" \
-H "Authorization: Bearer <User-JWT>"
Get Album Publishers
Retrieves a list of unique publishers from the albums in the database.
Details:
- Endpoint:
/api/db/publisher
- Method:
GET
- Authorization: JWT with Admin, User, or Pass role
Responses:
- 200 OK: A list of publishers is returned.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/db/publisher" \
-H "Authorization: Bearer <User-JWT>"
Get Track Genres
Retrieves a list of unique genres from the tracks in the database.
Details:
- Endpoint:
/api/db/genres
- Method:
GET
- Authorization: JWT with Admin, User, or Pass role
Responses:
- 200 OK: A list of genres is returned.
- 401 Unauthorized: User lacks necessary permissions.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/db/genres" \
-H "Authorization: Bearer <User-JWT>"