Fixed bandcamp to return albums and tracks instead of bands in music search
Some checks failed
Run Integration Tests / test (push) Failing after 3m3s

This commit is contained in:
partisan 2025-05-31 11:02:32 +02:00
parent 5032173609
commit ed588e8764

View file

@ -31,6 +31,14 @@ func SearchBandcamp(query string, page int) ([]MusicResult, error) {
var results []MusicResult
doc.Find("li.searchresult").Each(func(i int, s *goquery.Selection) {
// Extract the item type
itemType := strings.ToLower(strings.TrimSpace(s.Find("div.itemtype").Text()))
// Skip if the item is not an album or track
if itemType != "album" && itemType != "track" {
return
}
result := MusicResult{Source: "Bandcamp"}
// URL extraction