🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Only refresh smart playlist when fetching first track (#3244)
Kendall Garner9f1794b97ee2
diff --git a/server/nativeapi/playlists.go b/server/nativeapi/playlists.goindex 8f625aba1..09d8f8e16 100644--- a/server/nativeapi/playlists.go+++ b/server/nativeapi/playlists.go@@ -22,14 +22,16 @@ type restHandler = func(rest.RepositoryConstructor, ...rest.Logger) http.Handlerfunc getPlaylist(ds model.DataStore) http.HandlerFunc {// Add a middleware to capture the playlistIdwrapper := func(handler restHandler) http.HandlerFunc {- return func(res http.ResponseWriter, req *http.Request) {+ return func(w http.ResponseWriter, r *http.Request) {constructor := func(ctx context.Context) rest.Repository {plsRepo := ds.Playlist(ctx)- plsId := chi.URLParam(req, "playlistId")- return plsRepo.Tracks(plsId, true)+ plsId := chi.URLParam(r, "playlistId")+ p := req.Params(r)+ start := p.Int64Or("_start", 0)+ return plsRepo.Tracks(plsId, start == 0)}- handler(constructor).ServeHTTP(res, req)+ handler(constructor).ServeHTTP(w, r)}}