From ad5344b3097f2291fb83cc334e5f0c5d5eb62295 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Mon, 16 Mar 2026 23:36:36 +0100 Subject: [PATCH] Do not use /bmx for our custom endpoint (#115) Follow-up for https://github.com/gesellix/Bose-SoundTouch/pull/114 --- cmd/soundtouch-cli/cmd_source.go | 2 +- cmd/soundtouch-service/main.go | 1 - docs/guides/SOUNDTOUCH-SERVICE.md | 2 +- pkg/service/handlers/handlers_bmx_test.go | 2 +- pkg/service/handlers/main_test.go | 1 - 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/soundtouch-cli/cmd_source.go b/cmd/soundtouch-cli/cmd_source.go index 5ae98bd..ee5fbf2 100644 --- a/cmd/soundtouch-cli/cmd_source.go +++ b/cmd/soundtouch-cli/cmd_source.go @@ -268,7 +268,7 @@ func selectCustomRadio(c *cli.Context) error { serviceURL := c.String("service-url") encodedURL := base64.URLEncoding.EncodeToString([]byte(streamURL)) - location := fmt.Sprintf("%s/bmx/custom/v1/playback/%s", serviceURL, encodedURL) + location := fmt.Sprintf("%s/custom/v1/playback/%s", serviceURL, encodedURL) params := url.Values{} if itemName != "" { diff --git a/cmd/soundtouch-service/main.go b/cmd/soundtouch-service/main.go index ee62107..8736ec4 100644 --- a/cmd/soundtouch-service/main.go +++ b/cmd/soundtouch-service/main.go @@ -655,7 +655,6 @@ func setupRouter(server *handlers.Server) *chi.Mux { r.Get("/tunein/v1/playback/episodes/{podcastID}", server.HandleTuneInPodcastInfo) r.Get("/tunein/v1/playback/episode/{podcastID}", server.HandleTuneInPlaybackPodcast) r.Post("/orion/v1/playback/station/{data}", server.HandleOrionPlayback) - r.Get("/custom/v1/playback/{encodedURL}", server.HandleCustomPlayback) }) // Legacy or direct domain calls without /bmx prefix diff --git a/docs/guides/SOUNDTOUCH-SERVICE.md b/docs/guides/SOUNDTOUCH-SERVICE.md index 3c39734..9fc5d6a 100644 --- a/docs/guides/SOUNDTOUCH-SERVICE.md +++ b/docs/guides/SOUNDTOUCH-SERVICE.md @@ -797,7 +797,7 @@ func customBMXHandler(w http.ResponseWriter, r *http.Request) { func main() { r := chi.NewRouter() - r.Get("/bmx/custom/endpoint", customBMXHandler) + r.Get("/custom/endpoint", customBMXHandler) http.ListenAndServe(":8000", r) } ``` diff --git a/pkg/service/handlers/handlers_bmx_test.go b/pkg/service/handlers/handlers_bmx_test.go index 47ab170..ecfc455 100644 --- a/pkg/service/handlers/handlers_bmx_test.go +++ b/pkg/service/handlers/handlers_bmx_test.go @@ -120,7 +120,7 @@ func TestCustomPlayback(t *testing.T) { imageUrl := "http://example.com/img.jpg" name := "Test Custom" - res, err := http.Get(ts.URL + "/bmx/custom/v1/playback/" + encodedURL + "?imageUrl=" + url.QueryEscape(imageUrl) + "&name=" + url.QueryEscape(name)) + res, err := http.Get(ts.URL + "/custom/v1/playback/" + encodedURL + "?imageUrl=" + url.QueryEscape(imageUrl) + "&name=" + url.QueryEscape(name)) if err != nil { t.Fatal(err) } diff --git a/pkg/service/handlers/main_test.go b/pkg/service/handlers/main_test.go index 3ac789f..c5ad718 100644 --- a/pkg/service/handlers/main_test.go +++ b/pkg/service/handlers/main_test.go @@ -27,7 +27,6 @@ func setupRouter(targetURL string, ds *datastore.DataStore) (*chi.Mux, *Server) r.Get("/tunein/v1/playback/episodes/{podcastID}", server.HandleTuneInPodcastInfo) r.Get("/tunein/v1/playback/episode/{podcastID}", server.HandleTuneInPlaybackPodcast) r.Post("/orion/v1/playback/station/{data}", server.HandleOrionPlayback) - r.Get("/custom/v1/playback/{encodedURL}", server.HandleCustomPlayback) }) // Legacy or direct domain calls without /bmx prefix