feat(playlists): a user keeps playlists of tracks
Each user can make playlists: a name (1 to 200 characters), an optional description and an ordered list of tracks, where a track may appear more than once (each place has its own item id). The API makes, lists, renames and deletes playlists, and adds tracks (at the end or at a position), lists them, moves one and removes one; positions count from 0 without gaps. A playlist is its owner's alone: somebody else's answers playlist_not_found (404), as one that does not exist. A track whose files were deleted or moved stays in the playlist and is listed with available false. Deleting a user deletes their playlists. Limits: 1,000 playlists per user, 10,000 tracks per playlist, 500 tracks per request. Changes of one playlist are serialised by locking its row, so two requests at once keep the positions unique on PostgreSQL too. Migration 0019, OpenAPI spec, contract test, README and the web API types follow. The web app comes separately. Closes #89
This commit is contained in:
parent
bbb1e9847b
commit
f900a22904
1 changed files with 2732 additions and 2 deletions
|
|
@ -26,6 +26,7 @@ import (
|
|||
"codeberg.org/squidd/sonda/internal/jobs"
|
||||
"codeberg.org/squidd/sonda/internal/library"
|
||||
"codeberg.org/squidd/sonda/internal/listening"
|
||||
"codeberg.org/squidd/sonda/internal/playlists"
|
||||
"codeberg.org/squidd/sonda/internal/providers"
|
||||
"codeberg.org/squidd/sonda/internal/providers/commons"
|
||||
"codeberg.org/squidd/sonda/internal/providers/coverart"
|
||||
|
|
@ -277,6 +278,7 @@ func run() error {
|
|||
Taste: tasteService,
|
||||
Discover: discover.NewService(tasteService, discoveries, tags, tasteRepo, userSettings, feedbacks, weights),
|
||||
Feedback: feedbacks,
|
||||
Playlists: playlists.NewService(storage.NewPlaylistRepo(db)),
|
||||
Images: pictures,
|
||||
CoversJob: jobs.Runner{Ctx: ctx, Job: images.NewCoversJob(pictures, imageRepo)},
|
||||
ArtistImagesJob: jobs.Runner{Ctx: ctx, Job: images.NewArtistImagesJob(pictures, imageRepo)},
|
||||
|
|
|
|||
Loading…
Reference in a new issue