Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions content/en/docs/Endpoints/setrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change went to wrong place. Here it wouldn't have been necessary as the sentence below already covers the artist and album. Now there's unnecessary repetition. My previous comment was targeted to the summary in the header on the line 7 of this file.


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. |
Comment on lines +21 to +22

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the "Multiple parameters allowed" here on purpose? Unlike in the star and unstar endpoints, the original specification doesn't allow multiple target items in setRating. It might be a sensible extension to allow multiple targets also here but then we should apply this also to the id parameter.

| `rating` | **Yes** | | | The rating between 1 and 5 (inclusive), or 0 to remove the rating. |

### Example
Expand Down
19 changes: 19 additions & 0 deletions content/en/docs/Extensions/ratingID3.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions content/en/docs/Responses/ArtistID3.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ 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:

- `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.

Expand Down
2 changes: 2 additions & 0 deletions content/en/docs/Responses/ArtistWithAlbumsID3.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ 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:

- `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.

Expand Down
30 changes: 29 additions & 1 deletion openapi/endpoints/setRating.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions openapi/schemas/ArtistID3.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down