Soundcloud ruby gem - 流派/标签过滤器不起作用

Soundcloud ruby gem - genres / tags filter doesn't work

我正在尝试使用流派/标签上的过滤器来获取某些曲目,当它只有一种流派时它似乎可以工作,尽管当它是多个流派时它不起作用同时文档说它接受一个名单:https://developers.soundcloud.com/docs/api/reference#tracks

client.get('/tracks', limit: 200, order: 'created_at', 'duration[from]' => 
180_000, 'duration[to]' => 360_000, 'created_at[from]' => 
3.days.ago.strftime('%Y-%m-%d %I:%M:%S'), q: 'something', tags: ['House', 'Techno'])`

它没有 return 错误或任何错误,只是 returned 的曲目似乎没有选取过滤参数。 有/没有 gem 的其他人遇到过同样的问题吗?

好好看看 api 文档 https://developers.soundcloud.com/docs/api/reference#tracks

tags list a comma separated list of tags

不确定,但也许尝试使用字符串参数而不是文档所说的数组

client.get('/tracks', limit: 200, order: 'created_at', 
            'duration[from]' => 180_000, 'duration[to]' => 360_000, 
            'created_at[from]' => 3.days.ago.strftime('%Y-%m-%d %I:%M:%S'),
             q: 'something', tags: 'house,techno'
           )

如果您的标签中有 space,请使用 + 而不是 space,即

tags: 'house,techo,deep+house'

小写标签,因为 soundcloud 无论如何都会这样做,例如,您可以在浏览器中输入 https://soundcloud.com/search/?q=lacostenyc&tags=house,techno