feat(feedback): a wishlist and "not interested"
- PUT/DELETE /wishlist/{artist} and GET /wishlist: the artists I want.
- POST/DELETE /discover/{artist}/dismiss and GET /discover/dismissed: the
artists I am not interested in. An artist is wished or dismissed, never both,
and both lists are mine alone.
- Discover never suggests a dismissed artist, does not use one as a seed taken
from my listening, and marks the wished ones it shows (wishlisted).
- New artist_feedback table (migration 0012, SQLite and PostgreSQL), removed
with the account.
- An artist I marked is not cleaned up when the list that named it is replaced,
and goes when its last mark is taken off and nobody names it. Taking a
provider's data back still removes what only it named, marks included.
- Spec, contract test and README updated.
Closes #35
This commit is contained in:
parent
154701191b
commit
a6dbf60ac8
1 changed files with 1283 additions and 32 deletions
|
|
@ -722,6 +722,130 @@ paths:
|
|||
schema: {$ref: '#/components/schemas/Error'}
|
||||
'401': {$ref: '#/components/responses/Unauthorized'}
|
||||
|
||||
/discover/dismissed:
|
||||
get:
|
||||
tags: [Discovery]
|
||||
operationId: listDismissed
|
||||
summary: Artists you are not interested in
|
||||
description: |
|
||||
The artists you told Discover you are not interested in (`POST /discover/{id}/dismiss`),
|
||||
newest first. Only yours; nobody else's choices are visible or affect your Discover.
|
||||
security: [{bearerAuth: []}]
|
||||
parameters:
|
||||
- {$ref: '#/components/parameters/Limit'}
|
||||
- {$ref: '#/components/parameters/Offset'}
|
||||
responses:
|
||||
'200':
|
||||
description: A page of artists.
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/MarkedPage'}
|
||||
'400': {$ref: '#/components/responses/InvalidInput'}
|
||||
'401': {$ref: '#/components/responses/Unauthorized'}
|
||||
|
||||
/discover/{id}/dismiss:
|
||||
parameters:
|
||||
- {$ref: '#/components/parameters/Id'}
|
||||
post:
|
||||
tags: [Discovery]
|
||||
operationId: dismissArtist
|
||||
summary: Not interested in this artist
|
||||
description: |
|
||||
Hides the artist from your Discover: it is never suggested again, and an artist taken
|
||||
from your listening that you dismissed no longer seeds your suggestions. An artist is
|
||||
dismissed or on your wishlist, never both: dismissing one that is on the wishlist takes
|
||||
it off. Doing it twice is the same as once. Nothing is sent to anyone.
|
||||
|
||||
The artist can be one of yours or one a provider named. An artist that a provider named
|
||||
and nobody else does is kept for as long as it is dismissed, so the choice survives a
|
||||
new list from the provider; when an admin takes a provider's data back (`DELETE
|
||||
/providers/{name}/data`), what only that provider named goes, your choice with it.
|
||||
security: [{bearerAuth: []}]
|
||||
responses:
|
||||
'204': {description: "Done, also when it was already dismissed."}
|
||||
'400': {$ref: '#/components/responses/InvalidInput'}
|
||||
'401': {$ref: '#/components/responses/Unauthorized'}
|
||||
'404':
|
||||
description: No such artist (`artist_not_found`).
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/Error'}
|
||||
delete:
|
||||
tags: [Discovery]
|
||||
operationId: undismissArtist
|
||||
summary: Interested again
|
||||
description: Lets Discover suggest the artist again. A wish on the wishlist is not touched.
|
||||
security: [{bearerAuth: []}]
|
||||
responses:
|
||||
'204': {description: "Done, also when it was not dismissed."}
|
||||
'400': {$ref: '#/components/responses/InvalidInput'}
|
||||
'401': {$ref: '#/components/responses/Unauthorized'}
|
||||
'404':
|
||||
description: No such artist (`artist_not_found`).
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/Error'}
|
||||
|
||||
/wishlist:
|
||||
get:
|
||||
tags: [Discovery]
|
||||
operationId: listWishlist
|
||||
summary: Your wishlist
|
||||
description: |
|
||||
The artists you want, newest first. It is a list for you: nothing is downloaded or
|
||||
sent anywhere. `in_library` says whether there is music of the artist to play now, so a
|
||||
client can hide the ones you already got. Only yours.
|
||||
security: [{bearerAuth: []}]
|
||||
parameters:
|
||||
- {$ref: '#/components/parameters/Limit'}
|
||||
- {$ref: '#/components/parameters/Offset'}
|
||||
responses:
|
||||
'200':
|
||||
description: A page of artists.
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/MarkedPage'}
|
||||
'400': {$ref: '#/components/responses/InvalidInput'}
|
||||
'401': {$ref: '#/components/responses/Unauthorized'}
|
||||
|
||||
/wishlist/{id}:
|
||||
parameters:
|
||||
- {$ref: '#/components/parameters/Id'}
|
||||
put:
|
||||
tags: [Discovery]
|
||||
operationId: addToWishlist
|
||||
summary: Put an artist on your wishlist
|
||||
description: |
|
||||
Adds the artist. An artist is on the wishlist or dismissed, never both: adding one you
|
||||
dismissed lifts the dismissal. Doing it twice keeps the first date. The artist can be one
|
||||
of yours or one a provider named; the latter is kept while it is on a wishlist (see
|
||||
`POST /discover/{id}/dismiss` for what a purge does). Discover marks it `wishlisted`.
|
||||
security: [{bearerAuth: []}]
|
||||
responses:
|
||||
'204': {description: "Done, also when it was already there."}
|
||||
'400': {$ref: '#/components/responses/InvalidInput'}
|
||||
'401': {$ref: '#/components/responses/Unauthorized'}
|
||||
'404':
|
||||
description: No such artist (`artist_not_found`).
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/Error'}
|
||||
delete:
|
||||
tags: [Discovery]
|
||||
operationId: removeFromWishlist
|
||||
summary: Take an artist off your wishlist
|
||||
description: A dismissal of the artist is not touched.
|
||||
security: [{bearerAuth: []}]
|
||||
responses:
|
||||
'204': {description: "Done, also when it was not there."}
|
||||
'400': {$ref: '#/components/responses/InvalidInput'}
|
||||
'401': {$ref: '#/components/responses/Unauthorized'}
|
||||
'404':
|
||||
description: No such artist (`artist_not_found`).
|
||||
content:
|
||||
application/json:
|
||||
schema: {$ref: '#/components/schemas/Error'}
|
||||
|
||||
/me/taste:
|
||||
get:
|
||||
tags: [Taste]
|
||||
|
|
@ -1742,6 +1866,27 @@ components:
|
|||
type: array
|
||||
items: {$ref: '#/components/schemas/Suggestion'}
|
||||
|
||||
MarkedPage:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required: [items, total, limit, offset]
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
items: {$ref: '#/components/schemas/MarkedArtist'}
|
||||
total: {type: integer, description: "Size of the whole list, not of this page."}
|
||||
limit: {type: integer}
|
||||
offset: {type: integer}
|
||||
|
||||
MarkedArtist:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required: [artist, in_library, marked_at]
|
||||
properties:
|
||||
artist: {$ref: '#/components/schemas/ArtistRef'}
|
||||
in_library: {type: boolean, description: Whether there is music of the artist to play.}
|
||||
marked_at: {type: string, format: date-time}
|
||||
|
||||
DiscoverSeed:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
|
@ -1754,10 +1899,11 @@ components:
|
|||
Suggestion:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required: [artist, in_library, score, components, because]
|
||||
required: [artist, in_library, wishlisted, score, components, because]
|
||||
properties:
|
||||
artist: {$ref: '#/components/schemas/ArtistRef'}
|
||||
in_library: {type: boolean}
|
||||
wishlisted: {type: boolean, description: True when the artist is on your wishlist.}
|
||||
score: {type: number, minimum: 0, maximum: 1}
|
||||
components: {$ref: '#/components/schemas/ScoreParts'}
|
||||
because:
|
||||
|
|
|
|||
Loading…
Reference in a new issue