mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-12 12:27:09 +02:00
feat: persist and expose plugin playlist ValidUntil in Subsonic API
Add a ValidUntil field to the Playlist model and persist it from the plugin's GetPlaylistResponse during sync. This allows clients to know when a plugin playlist's data will be refreshed. The value is exposed in the OpenSubsonic playlist response alongside the existing smart playlist ValidUntil calculation. The migration is consolidated into a single multi-statement ExecContext call.
This commit is contained in:
parent
a5fd18dc67
commit
9ddbcbf6b4
6 changed files with 33 additions and 22 deletions
|
|
@ -200,6 +200,10 @@ func (p *playlistSyncer) syncPlaylist(info capabilities.PlaylistInfo, dbID strin
|
|||
PluginID: p.pluginName,
|
||||
PluginPlaylistID: info.ID,
|
||||
}
|
||||
if resp.ValidUntil > 0 {
|
||||
t := time.Unix(resp.ValidUntil, 0)
|
||||
pls.ValidUntil = &t
|
||||
}
|
||||
|
||||
// Set tracks from matched media files
|
||||
pls.AddMediaFiles(matched)
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ var _ = Describe("PlaylistProvider", Ordered, func() {
|
|||
Expect(dailyMix1.PluginID).To(Equal("test-playlist-provider"))
|
||||
Expect(dailyMix1.PluginPlaylistID).To(Equal("daily-mix-1"))
|
||||
Expect(dailyMix1.Public).To(BeFalse())
|
||||
Expect(dailyMix1.ValidUntil).To(BeNil())
|
||||
})
|
||||
|
||||
It("generates deterministic playlist IDs", func() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue