在我们的 Spotify 应用程序中,我们正在调用 model.Search 函数,以便我们可以验证最多 100 位艺术家的列表。问题是我们可能正在验证的艺术家之一可能类似于“!!!”。这是一个实际的艺术家姓名,但它会导致 Spotify 返回错误代码和已验证艺术家姓名的空列表。我们可以在应用程序中一一验证艺术家姓名,从而处理错误代码,但这会大大降低应用程序的速度。这是 API 中的错误吗?Spotify会很快修复它吗?这是我们正在进行的调用的示例:
var search = new models.Search("artist:"Mother Love Bone" OR artist:"Hole" OR artist:"Soundgarden" OR artist:"Stone Temple Pilots" OR artist:"Blind Melon" OR artist:"Silverchair" OR artist:"Alice In Chains" OR artist:"Bush" OR artist:"Nirvana" OR artist:"Pearl Jam" OR artist:"Big Black" OR artist:"Hüsker Dü" OR artist:"Throwing Muses" OR artist:"Frank Black" OR artist:"Fugazi" OR artist:"Santogold" OR artist:"This Mortal Coil" OR artist:"Pixies" OR artist:"Lykke Li" OR artist:"Dinosaur Jr." OR artist:"Dinosaur Jr" OR artist:"Morphine" OR artist:"Guided By Voices" OR artist:"Spacemen 3" OR artist:"Ride" OR artist:"My Bloody Valentine" OR artist:"Destroyer" OR artist:"Slowdive" OR artist:"Spiritualized" OR artist:"Wavves" OR artist:"Joanna Newsom" OR artist:"The Beta Band" OR artist:"The Jon Spencer Blues Explosion" OR artist:"Jon Spencer Blues Explosion" OR artist:"Death From Above 1979" OR artist:"Buzzcocks" OR artist:"The Buzzcocks" OR artist:"Television" OR artist:"Battles" OR artist:"Morrissey" OR artist:"The Stone Roses" OR artist:"Ian Brown" OR artist:"The Libertines" OR artist:"The Psychedelic Furs" OR artist:"Psychedelic Furs" OR artist:"Kings Of Convenience" OR artist:"Happy Mondays" OR artist:"Yo La Tengo" OR artist:"Echo & The Bunnymen" OR artist:"The Specials" OR artist:"Interpol" OR artist:"Yeah Yeah Yeahs" OR artist:"Doves" OR artist:"Dover" OR artist:"Joy Division" OR artist:"Silver Jews" OR artist:"!!!"");
search.localResults = models.LOCALSEARCHRESULTS.IGNORE;
search.searchArtists = true;
search.searchAlbums = false;
search.searchTracks = false;
search.searchPlaylists = false;
search.observe(models.EVENT.CHANGE, function() { ... });
search.observe(models.EVENT.LOAD_ERROR, function() { // We got error here });
search.appendNext();