Skip to content

Commit 3e14a2d

Browse files
Merge pull request #4 from GerardPolloRebozado/fix/search-without-query
fix: 🐛 search endpoint was searching externally even when search …
2 parents 054bd3c + 4446ef3 commit 3e14a2d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/api/handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ func (h *Handler) SmartSearch(w http.ResponseWriter, r *http.Request) {
5252
ctx, cancel := context.WithTimeout(r.Context(), 12*time.Second)
5353
defer cancel()
5454

55+
log.Printf("Search query: %s", query)
56+
if query == "\"\"" || query == "" {
57+
h.rp.ServeHTTP(w, r)
58+
}
5559
body, contentType, err := h.searchService.SmartSearch(ctx, query, r.URL.Path, r.URL.RawQuery)
5660
if err != nil {
5761
http.Error(w, "Internal Server Error", http.StatusInternalServerError)

src/metadata/MusicBrainz.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (p *MusicBrainzProvider) GetAlbum(ctx context.Context, id string) (*model.S
2929
func NewMusicBrainzProvider(limit int) *MusicBrainzProvider {
3030
return &MusicBrainzProvider{musicbrainzws2.NewClient(musicbrainzws2.AppInfo{
3131
Name: "navifetch",
32-
Version: "0.10.0",
32+
Version: "0.10.1",
3333
URL: "https://github.com/GerardPolloRebozado/navifetch",
3434
}),
3535
musicbrainzws2.Paginator{

0 commit comments

Comments
 (0)