mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-04 01:08:54 +01:00
Merge remote-tracking branch 'origin/master' into feat/artwork-blurhash
# Conflicts: # model/playlist.go # model/playlist_test.go
This commit is contained in:
commit
4d8b486dfd
13 changed files with 349 additions and 6 deletions
|
|
@ -168,7 +168,7 @@ func buildOSPlaylist(ctx context.Context, p model.Playlist) *responses.OpenSubso
|
|||
pls.Readonly = true
|
||||
|
||||
if p.EvaluatedAt != nil {
|
||||
pls.ValidUntil = new(p.EvaluatedAt.Add(conf.Server.SmartPlaylistRefreshDelay))
|
||||
pls.ValidUntil = new(p.EvaluatedAt.Add(p.RefreshDelay()))
|
||||
}
|
||||
} else {
|
||||
user, ok := request.UserFrom(ctx)
|
||||
|
|
|
|||
|
|
@ -248,6 +248,20 @@ var _ = Describe("buildPlaylist", func() {
|
|||
Expect(result.OpenSubsonicPlaylist).To(BeNil())
|
||||
})
|
||||
})
|
||||
|
||||
Context("with a per-playlist refreshDelay", func() {
|
||||
BeforeEach(func() {
|
||||
playlist.Rules.RefreshDelay = 24 * time.Hour
|
||||
player := model.Player{Client: "regular-client"}
|
||||
ctx = request.WithPlayer(ctx, player)
|
||||
})
|
||||
|
||||
It("computes validUntil from the playlist's own delay", func() {
|
||||
result := router.buildPlaylist(ctx, playlist)
|
||||
expected := evaluatedAt.Add(24 * time.Hour)
|
||||
Expect(result.ValidUntil).To(Equal(&expected))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Describe("annotation leakage", func() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue