mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-26 10:30:46 +00:00
feat: add server-managed fields for plugin playlists in rest adapter
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
ae8263671a
commit
439cff47ac
2 changed files with 9 additions and 0 deletions
|
|
@ -69,6 +69,9 @@ func (s *playlists) savePlaylist(ctx context.Context, pls *model.Playlist) (stri
|
|||
pls.UploadedImage = "" // Managed by image upload endpoint
|
||||
pls.ExternalImageURL = "" // Managed by M3U import / plugins only
|
||||
pls.EvaluatedAt = nil // Server-managed
|
||||
pls.PluginID = "" // Server-managed (plugin system)
|
||||
pls.PluginPlaylistID = "" // Server-managed (plugin system)
|
||||
pls.ValidUntil = nil // Server-managed (plugin system)
|
||||
err := s.ds.Playlist(ctx).Put(pls)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@ var _ = Describe("REST Adapter", func() {
|
|||
UploadedImage: "injected-image-path",
|
||||
ExternalImageURL: "http://evil.example.com/ssrf",
|
||||
EvaluatedAt: &now,
|
||||
PluginID: "fake-plugin",
|
||||
PluginPlaylistID: "fake-playlist-id",
|
||||
ValidUntil: &now,
|
||||
}
|
||||
_, err := repo.Save(pls)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
|
@ -90,6 +93,9 @@ var _ = Describe("REST Adapter", func() {
|
|||
Expect(saved.UploadedImage).To(BeEmpty())
|
||||
Expect(saved.ExternalImageURL).To(BeEmpty())
|
||||
Expect(saved.EvaluatedAt).To(BeNil())
|
||||
Expect(saved.PluginID).To(BeEmpty())
|
||||
Expect(saved.PluginPlaylistID).To(BeEmpty())
|
||||
Expect(saved.ValidUntil).To(BeNil())
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue