diff --git a/content/en/docs/Endpoints/setrating.md b/content/en/docs/Endpoints/setrating.md index 98543386..b9423bac 100644 --- a/content/en/docs/Endpoints/setrating.md +++ b/content/en/docs/Endpoints/setrating.md @@ -9,13 +9,17 @@ description: > `http://your-server/rest/setRating` Since [1.6.0](../../subsonic-versions) -Sets the rating for a music file. +Sets the rating for a music file, folder, album, or artist. + +Servers implementing the [ratingID3 extension](../Extensions/ratingID3.md) additionally support setting ratings for ArtistID3 and AlbumID3. ### Parameters | Parameter | Req. | OpenS. | Default | Comment | | --- | --- | --- | --- | --- | -| `id` | **Yes** | | | A string which uniquely identifies the file (song) or folder (album/artist) to rate. | +| `id` | No | | | A string which uniquely identifies the file (song) or folder (album/artist) to rate. | +| `artistId` | No | **Yes** | | The ID of an artistID3 to rate. Multiple parameters allowed. Supported by servers implementing the ratingID3 extension. | +| `albumId` | No | **Yes** | | The ID of an albumID3 to rate. Multiple parameters allowed. Supported by servers implementing the ratingID3 extension. | | `rating` | **Yes** | | | The rating between 1 and 5 (inclusive), or 0 to remove the rating. | ### Example diff --git a/content/en/docs/Extensions/ratingID3.md b/content/en/docs/Extensions/ratingID3.md new file mode 100644 index 00000000..c172d13f --- /dev/null +++ b/content/en/docs/Extensions/ratingID3.md @@ -0,0 +1,19 @@ +--- +title: "Rating ID3" +linkTitle: "Rating ID3" +OpenSubsonic: +- Extension +description: > + Adds support for setting user ratings to ArtistID3 and AlbumID3 types. +--- + +**OpenSubsonic version**: [1](../../opensubsonic-versions) + +**OpenSubsonic extension name**: `ratingID3` (As returned by [`getOpenSubsonicExtensions`](../../endpoints/getopensubsonicextensions)) + +## Version 1 + +Supporting this extension means that: + +- The server supports the `userRating` field on [`AlbumID3`](../Responses/AlbumID3.md) and [`ArtistID3`](../Responses/ArtistID3.md) +- The [`setRating`](../Endpoints/setrating.md) endpoint supports the `albumId` and `artistId` parameters to apply user ratings to AlbumID3 and ArtistID3. diff --git a/content/en/docs/Responses/ArtistID3.md b/content/en/docs/Responses/ArtistID3.md index 13dfe36d..beb42fb5 100644 --- a/content/en/docs/Responses/ArtistID3.md +++ b/content/en/docs/Responses/ArtistID3.md @@ -51,6 +51,7 @@ description: > | `musicBrainzId` | `string` | No | **Yes** | The artist MusicBrainzID. | | `sortName` | `string` | No | **Yes** | The artist sort name. | | `roles` | Array of `string` | No | **Yes** | The list of all roles this artist has in the library. | +| `userRating` | `int` | No | **Yes** | The user rating of the artist. [1-5]| {{< alert color="warning" title="OpenSubsonic" >}} New fields are added: @@ -58,6 +59,7 @@ New fields are added: - `musicBrainzId` - `sortName` - `roles` +- `userRating` **Note**: All OpenSubsonic added fields are **optionals**. But if a server support a field it **must** return it with an empty / default value when not present in it's database so that clients knows what the server supports. diff --git a/content/en/docs/Responses/ArtistWithAlbumsID3.md b/content/en/docs/Responses/ArtistWithAlbumsID3.md index 07e144eb..6b4400cd 100644 --- a/content/en/docs/Responses/ArtistWithAlbumsID3.md +++ b/content/en/docs/Responses/ArtistWithAlbumsID3.md @@ -94,6 +94,7 @@ description: > | `musicBrainzId` | `string` | No | **Yes** | The artist MusicBrainzID. | | `sortName` | `string` | No | **Yes** | The artist sort name. | | `roles` | Array of `string` | No | **Yes** | The list of all roles this artist has in the library. | +| `userRating` | `int` | No | **Yes** | The user rating of the artist. [1-5] | {{< alert color="warning" title="OpenSubsonic" >}} New fields are added: @@ -101,6 +102,7 @@ New fields are added: - `musicBrainzId` - `sortName` - `roles` +- `userRating` **Note**: All OpenSubsonic added fields are **optionals**. But if a server support a field it **must** return it with an empty / default value when not present in it's database so that clients knows what the server supports. diff --git a/openapi/endpoints/setRating.json b/openapi/endpoints/setRating.json index b29cd77a..63728bb5 100644 --- a/openapi/endpoints/setRating.json +++ b/openapi/endpoints/setRating.json @@ -11,11 +11,39 @@ "name": "id", "in": "query", "description": "A string which uniquely identifies the file (song) or folder (album/artist) to rate.", - "required": true, + "required": false, "schema": { "type": "string" } }, + { + "name": "artistId", + "in": "query", + "description": "A string which uniquely identifies the artistID3 to rate. Supported by servers implementing the ratingID3 extension.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "style": "form", + "explode": true + }, + { + "name": "albumId", + "in": "query", + "description": "A string which uniquely identifies the albumID3 to rate. Supported by servers implementing the ratingID3 extension.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "style": "form", + "explode": true + }, { "name": "rating", "in": "query", diff --git a/openapi/schemas/ArtistID3.json b/openapi/schemas/ArtistID3.json index df18a693..398f2aeb 100644 --- a/openapi/schemas/ArtistID3.json +++ b/openapi/schemas/ArtistID3.json @@ -41,6 +41,12 @@ "type": "string" }, "description": "The list of all roles this artist has in the library." + }, + "userRating": { + "type": "integer", + "minimum": 1, + "maximum": 5, + "description": "The user rating for this artist (1-5)." } }, "required": [