feat(smart): covers on the Smart playlists page

- GET /smart-playlists/{id}/covers and GET /smart-playlists/suggested/{key}/covers say which albums stand for a smart playlist: up to 4 albums that have a cover, in the order of the songs the rules give now (for the variant asked), each once. They are worked out apart from the songs, and the answer may be kept for a few minutes.
- The cards of the Smart playlists page are a grid with the collage. The list shows at once and each card asks for its own covers after that, showing the rings until they arrive or when they cannot be read.
- The pages of a smart playlist and of a suggested one use the same covers for the variant on screen, so only albums that have a cover are shown.
This commit is contained in:
tgiachi 2026-11-13 11:41:23 +01:00
commit 82b92eaf08

View file

@ -1426,6 +1426,34 @@ paths:
'401': {$ref: '#/components/responses/Unauthorized'}
'404': {$ref: '#/components/responses/SuggestedNotFound'}
/smart-playlists/suggested/{key}/covers:
parameters:
- {$ref: '#/components/parameters/SuggestedKey'}
get:
tags: [Smart playlists]
operationId: getSuggestedSmartPlaylistCovers
summary: The covers of a suggested smart playlist
description: |
Up to 4 albums that have a cover and stand for it, in the order of the songs the rules give now (the ones of
`variant`), each once: their covers (`GET /albums/{id}/cover`) make its picture. It is worked out apart from the
songs so that a list of smart playlists can show the rest without waiting for the rules of every one of them; the
answer may be kept by the client for a few minutes. Empty when none of the songs has an album with a cover.
security: [{bearerAuth: []}]
parameters:
- name: variant
in: query
description: The variant that is on screen, from 0 (the songs of the day) up.
schema: {type: integer, minimum: 0, maximum: 1000000, default: 0}
responses:
'200':
description: The albums.
content:
application/json:
schema: {$ref: '#/components/schemas/SmartCovers'}
'400': {$ref: '#/components/responses/InvalidInput'}
'401': {$ref: '#/components/responses/Unauthorized'}
'404': {$ref: '#/components/responses/SuggestedNotFound'}
/smart-playlists/suggested/{key}/playlist:
parameters:
- {$ref: '#/components/parameters/SuggestedKey'}
@ -1540,6 +1568,34 @@ paths:
'401': {$ref: '#/components/responses/Unauthorized'}
'404': {$ref: '#/components/responses/SmartPlaylistNotFound'}
/smart-playlists/{id}/covers:
parameters:
- {$ref: '#/components/parameters/Id'}
get:
tags: [Smart playlists]
operationId: getSmartPlaylistCovers
summary: The covers of a smart playlist
description: |
Up to 4 albums that have a cover and stand for it, in the order of the songs the rules give now (the ones of
`variant`), each once: their covers (`GET /albums/{id}/cover`) make its picture. It is worked out apart from the
songs so that a list of smart playlists can show the rest without waiting for the rules of every one of them; the
answer may be kept by the client for a few minutes. Empty when none of the songs has an album with a cover.
security: [{bearerAuth: []}]
parameters:
- name: variant
in: query
description: The variant that is on screen, from 0 (the songs of the day) up.
schema: {type: integer, minimum: 0, maximum: 1000000, default: 0}
responses:
'200':
description: The albums.
content:
application/json:
schema: {$ref: '#/components/schemas/SmartCovers'}
'400': {$ref: '#/components/responses/InvalidInput'}
'401': {$ref: '#/components/responses/Unauthorized'}
'404': {$ref: '#/components/responses/SmartPlaylistNotFound'}
/smart-playlists/{id}/playlist:
parameters:
- {$ref: '#/components/parameters/Id'}
@ -3833,6 +3889,13 @@ components:
limit: {type: integer, minimum: 1, maximum: 500, default: 50}
variant: {type: integer, minimum: 0, maximum: 1000000, default: 0}
SmartCovers:
type: object
additionalProperties: false
required: [album_ids]
properties:
album_ids: {type: array, maxItems: 4, items: {type: integer, format: int64}}
SmartTracks:
type: object
additionalProperties: false