【发布时间】:2015-06-08 05:19:16
【问题描述】:
在 iTunes 搜索 apidoc 中有一个搜索名为 maroon 的艺术家的示例,网址如下:
https://itunes.apple.com/search?term=maroon&entity=allArtist&attribute=allArtistTerm
这会返回 50 多个这样开始的结果:
{
"resultCount": 50,
"results": [
{
"wrapperType": "artist",
"artistType": "Artist",
"artistName": "Maroon 5",
"artistLinkUrl": "https://itunes.apple.com/us/artist/maroon-5/id1798556?uo=4",
"artistId": 1798556,
"amgArtistId": 529962,
"primaryGenreName": "Pop",
"primaryGenreId": 14,
"radioStationUrl": "https://itunes.apple.com/station/idra.1798556"
},
{
"wrapperType": "artist",
"artistType": "Software Artist",
"artistName": "MaroonEntertainment",
"artistLinkUrl": "https://itunes.apple.com/us/artist/maroonentertainment/id537029262?uo=4",
"artistId": 537029262,
"radioStationUrl": "https://itunes.apple.com/station/idra.537029262"
},
这很好。但是,这是我的问题:我想创建一个尽可能具体的搜索查询,方法是将搜索艺术家和歌曲名称以及专辑名称结合起来。..
例如,我得到了这首歌:
- 歌曲:跨越大鸿沟
- 专辑:大鸿沟
- 艺术家: Semisonic
我只能搜索艺术家姓名:
https://itunes.apple.com/search?term=Semisonic&entity=allArtist&attribute=allArtistTerm
我只能搜索歌曲词:
https://itunes.apple.com/search?term=Across the Great Divide&entity=song&attribute=songTerm
我只能搜索专辑名称:
https://itunes.apple.com/search?term=Great Divide&entity=album&attribute=albumTerm
但是这些人都没有给我我想要的结果(我可以在其他 50 人中找到我正在寻找的结果.. 但我只是希望搜索查询足够具体以避免任何客户端过滤类型东西)。
如何组合这些搜索?如果我只是将两个搜索添加在一起(在本例中,我正在搜索歌曲 和 艺术家):
https://itunes.apple.com/search?term=Across the Great Divide&entity=song&attribute=songTerm&term=Semisonic&entity=allArtist&attribute=allArtistTerm
然后苹果将简单地忽略第一个搜索类型(即歌曲)并仅返回艺术家的结果)。
想法?
【问题讨论】:
标签: objective-c itunes itunes-sdk itunes-search-api