2013-09-27 83 views
1

好的。这太疯狂了。我一直在努力尝试不同的怪事。我想昨晚我有一个关于libSpotify的恶梦,可能是我睡眠习惯的产物,但是,我离题了。SPAlbumBrowse - 获取艺术家专辑的准确名单

无论如何。让我们用下面的代码查找艺术家“The XX”。假设艺术家与艺术家的 “XX”,Spotify的URL Spotify的初始化:艺术家:3iOvXCl6edW5Um0fXEBRXy

artistBrowse = [[SPArtistBrowse alloc] initWithArtist: artist inSession: spotifySession type: SP_ARTISTBROWSE_ALBUMS]; 

[SPAsyncLoading waitUntilLoaded: artistBrowse timeout: kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedItems, NSArray *notLoadedItems) { 
    [SPAsyncLoading waitUntilLoaded: artistBrowse.albums timeout: kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedItems, NSArray *notLoadedItems) { 
     NSArray *types = @[@"a", @"s", @"c", @"u"]; 
     for(SPAlbum *album in loadedItems) { 
      NSLog(@"%@, %@, %@, %d, %-50s, %@", types[album.type], album.available ? @"Y" : @" N", album.artist.name, album.year, album.name.UTF8String, album.spotifyURL); 
     } 
    }]; 
}]; 

这里的输出。对不起,它有点冗长。请注意,第一列是指专辑的SP_ALBUM_TYPE(a =专辑,s = single,c =编辑,u =未知),第二列是Y或N,取决于专辑在我的会话区域是否可用美国),第三列是艺术家姓名,第五列是专辑年份,第六列是专辑名称,最后是专辑的Spotify网址。

u, N, The xx     , 2012, Coexist           , spotify:album:2cRMVS71c49Pf5SnIlJX3U 
u, N, The xx     , 2009, xx            , spotify:album:2rmMeEq5D1Bg7YFRwtHBDr 
a, N, The xx     , 2009, xx            , spotify:album:2nXJkqkS1tIKIyhBcFMmwz 
s, Y, The xx     , 2013, Reunion (Edu Imbernon Remix)      , spotify:album:4GRHNZJ1dWCqgWfiyyJF2L 
u, N, The xx     , 2013, Fiction           , spotify:album:4fUxANSrGWQlRtF2kpxo6g 
s, Y, The xx     , 2013, Innervisions Remixes        , spotify:album:4ZmviA6XFr2D2Bfw0bicwa 
s, Y, The xx     , 2013, Sunset (Jamie Jones Remix)      , spotify:album:1XlsTZcDbHQmLr3tNvuV5o 
s, Y, The xx     , 2013, Sunset (Kim Ann Foxman Remix)      , spotify:album:26gAjcYx9iGrOuplES6jC1 
s, Y, The xx     , 2012, Angels           , spotify:album:7kuu8alOjlFTGJmwsRINz9 
s, Y, The xx     , 2012, Angels (Four Tet Remix)       , spotify:album:4ZLWktgv4GJSgzzskz6rpI 
s, Y, The xx     , 2012, Chained (John Talabot and Pional Blinded Remix) , spotify:album:2PsFbWSt7nAwZuO6M6zeMU 
s, Y, The xx     , 2012, Chained (LIAR Remix)        , spotify:album:6HrD4wpVXVfXkZP1gxcKyH 
s, Y, The xx     , 2012, Jamie xx Edits         , spotify:album:33UOrxCqUHQDH3XvNEYWoP 
s, N, The xx     , 2009, Basic Space          , spotify:album:0LusnqOZqR8IYXHWE3DSQI 
s, N, The xx     , 2009, Basic Space          , spotify:album:6aStvQrltK28rgDFsyOsBS 
s, Y, The xx     , 2009, Crystalised          , spotify:album:6npsIAD3tolsM1htkmCDpT 
s, N, The xx     , 2009, Islands           , spotify:album:7rW7Zf8fTJT25wMo4z6ww3 
s, N, The xx     , 2009, Islands           , spotify:album:0KVBiUIqhl087FgJyvr8kS 
s, N, The xx     , 2009, VCR            , spotify:album:0eRJD5ey3HqIgsGheUwZqg 
s, Y, The xx     , 2009, VCR (Four Tet Remix)        , spotify:album:0L1Dg07wMBxRkzO5qlN1li 
s, N, The xx     , 2009, xx            , spotify:album:0z6ErTRiEcAML2IPrkWI5W 
a, N, Various Artists   , 2013, Circus HalliGalli         , spotify:album:0SCDZwyv5MbWsCdmeRHJUb 
a, N, Craig Armstrong   , 2013, The Orchestral Score From Baz Luhrmann's Film The Great Gatsby, spotify:album:7hTAlVO7LPTI5Q3KI5rTkR 
a, Y, Craig Armstrong   , 2013, The Orchestral Score From Baz Luhrmann's Film The Great Gatsby, spotify:album:6OuywehyzlNMYklKnPpr1W 
a, N, Various Artists   , 2013, Ministry Of Sound Chillout Sessions Classics  , spotify:album:4yfIS04c7NLu20GEx0fKLm 
a, N, Various Artists   , 2013, Young Folks          , spotify:album:56HMwAOWW0jnAH7J1S71Q1 
a, N, Various Artists   , 2013, Dance Anthems (Summer Edition 2013)    , spotify:album:25uYDaqMIFjCSKKWgDpDuM 
a, N, Various Artists   , 2013, FluxFM - Popkultur kompakt Vol. 1     , spotify:album:44OoPqLioRdPtG181OSWXO 
a, Y, Various Artists   , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:0ke0VwcET1D6neauEyk4U4 
a, Y, Various Artists   , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:1ApOUkhympslVqgf9QFHUj 
a, Y, Various Artists   , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:4fPvaODSSdvvP7nuVKCYW2 
a, N, Various Artists   , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:0WXuzb6XoO21qOswVOH0xG 
a, N, Various Artists   , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:2XVXltseIMrGuK09ck7TpS 
a, N, Various Artists   , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:4zmVotzGvedZLgLt7b9enu 
a, N, Various Artists   , 2013, De Afrekening 54         , spotify:album:5v4Mk83IAaZF8v2ZJlR3zJ 
a, N, Various Artists   , 2013, Ministry of Sound FUT.UR.ISM      , spotify:album:2oliIwXGnek066NvzFOyMh 
a, N, Various Artists   , 2013, Dermot O'Leary Presents The Saturday Sessions 2013, spotify:album:0vxrNQhxXzFHDoDe8ujfmC 
a, N, Various Artists   , 2013, Dermot O'Leary Presents The Saturday Sessions 2013, spotify:album:4IjdYP8ejVAUVhYEHIxV69 
a, N, Various Artists   , 2013, Switch 21           , spotify:album:2asHAel3cC4en0vj8OvL14 
a, N, Various Artists   , 2013, BRIT Awards 2013         , spotify:album:42DRlqFzejkEI1wTjggazF 
a, N, Various Artists   , 2013, about:berlin vol:2        , spotify:album:2M4eESAbUIRLtcoTZWKSwd 
a, N, Various Artists   , 2012, De Afrekening 53 - Best Of 2012     , spotify:album:3EZr5R7qYv49m80jTjjURV 
a, N, Various Artists   , 2012, Thank God It's Friday        , spotify:album:0uUKY9EW6pQN8SPzU9vUyd 
a, N, Various Artists   , 2012, Humo 2012           , spotify:album:3JUslyKt2lAhaQdwX2nsCu 
a, N, Various Artists   , 2012, FM4 Soundselection Vol.27       , spotify:album:6vWWIRMgDoy3bYkX6oYy6j 
a, N, Various Artists   , 2012, Ministry of Sound Chillout Sessions XV   , spotify:album:1luLiZ8M8yvlwwaLZNkBxI 
a, N, Various Artists   , 2012, Life Is Music 2012/2        , spotify:album:5uobOKU5V5Gdkr89uioVSk 
a, N, Various Artists   , 2012, Pure FM Vol.3 - Best Of 2012      , spotify:album:6VZUAizoJYpXS614EhuErD 
a, N, Various Artists   , 2012, Festivalitis          , spotify:album:1Wzv0KyuSgZhXJTVSHuZMR 
a, N, Various Artists   , 2012, Sonar 1000 Vol.2         , spotify:album:6RygdphSUzqmQI0tY0XTC8 
a, N, Various Artists   , 2012, We Love Real Music        , spotify:album:3YTlHLpLTpAPYzkh05iewe 
a, N, Various Artists   , 2012, Alle 40 Goed: Alternative       , spotify:album:2v7n6Lgf0IV3bWqsxczFYO 
a, N, Various Artists   , 2012, Alle 40 Goed: Alternative       , spotify:album:3Xy2qnFEUNjHMXAF3AlHhD 
a, N, The Antlers    , 2011, Together           , spotify:album:5k6JBXhKxclnxOtGtvpxXP 
a, N, Various Artists   , 2011, Radio 1 Sonar 1000        , spotify:album:0ZiepVOAQGrWIl7AeUUsEy 
a, N, Various Artists   , 2011, Ministry of Sound Uncovered 3      , spotify:album:31Ut6kXlaSoADr5k52rYQb 
a, N, Various Artists   , 2011, The Weather Channel Presents – The Sounds Of Winter, spotify:album:3TWTfxuFaMCcQMHomKRTpN 
a, N, Various Artists   , 2011, Solid Sounds 2011/1        , spotify:album:46lwy99LsDyubeZU2KK5kB 
a, N, Various Artists   , 2010, Humo's Top 2010         , spotify:album:6Cvt2RPh9ANl4CUMXGSFHu 
a, N, Various Artists   , 2010, Ministry Of Sound Chillout Sessions XIII   , spotify:album:2ze7hxcYnwo4CpdyK63xGQ 
a, Y, The Big Pink    , 2010, Tapes            , spotify:album:1RW3Hq6dTHn1Phur2dRvg3 
c, Y, The Big Pink    , 2010, Tapes            , spotify:album:2GJplTNzOUot6it93FtfLu 
a, N, Mario Basanov   , 2010, Future Balearica: New Chill & Warm Sunset Sounds , spotify:album:0I3COq9K4saT03qXsCmq6c 
a, N, Various Artists   , 2010, Volume.at - Alternative Summer 2010    , spotify:album:5juF4xi88AVJCreQCdm319 
a, N, Various Artists   , 2010, Festivalguide 2010        , spotify:album:3B066qff9ZcbFuFWC4vYai 
a, N, Various Artists   , 2010, Life Is Music 2010-1        , spotify:album:2jsGbNXBbjI933cmL9kGms 
a, N, Various Artists   , 2010, Uncovered 2          , spotify:album:3TEnNtbEnahNSkmcp0xQFZ 
a, N, Various Artists   , 2010, Various Artists/Rough Trade Counter Culture 09 , spotify:album:0KRR3PXLfJlIccrlgAllBh 

在这些数据中,我想提取如下内容。这些是他们艺术家页面上的xx相册,官方的Spotify桌面客户端与我用来登录libSpotify的帐户相同。

注意,在输出中,我已经加载的所有从artistBrowse.albums的专辑后,也将两个项目是实际的相簿,请在我的区域是列为不可用所有和实际上只有一个被列为专辑。

u, N, The xx     , 2012, Coexist           , spotify:album:2cRMVS71c49Pf5SnIlJX3U 
u, N, The xx     , 2009, xx            , spotify:album:2rmMeEq5D1Bg7YFRwtHBDr 
a, N, The xx     , 2009, xx            , spotify:album:2nXJkqkS1tIKIyhBcFMmwz 

我该如何解决这个问题?很多时候,如果你去检查web-api并通过album.available的Spotify网址来表示它们在我的区域不可用,那么“US”区域代码在专辑结果页面的输出中是正确的来自web-api。其次,我一直都会得到不同的结果。没有什么一致的,有时候红辣椒的专辑“I'm With You”出现在我的地区,有时在我的地区没有可用的。如果有唱片不可用在我的区域,有时调用另一个waitUntiLoaded:呼叫与loadedItems返回waitUntilLoaded电话与artistBrowse.albums解决的问题;再次加载“加载项目”可以缓解这个问题?这甚至没有意义。

最后,wtf。

a, N, Rihanna     , 2012, Unaplogetic          , spotify:album:4owyFvp5H3UXKIOBBT9x3m 
a, Y, Rihanna     , 2012, Unapologetic          , spotify:album:0XJya16l3K1J2dEwY19F8z 
a, Y, Rihanna     , 2012, Unapologetic          , spotify:album:4eddbruVtOqw8khwxSH6H2 
a, N, Rihanna     , 2012, Unapologetic          , spotify:album:4XBfFj0WYyh5mBtU61EdyY 
a, N, Rihanna     , 2012, Unapologetic          , spotify:album:5pLlGJrxuQO3jMoQe1XxZY 
a, N, Rihanna     , 2012, Unapologetic          , spotify:album:0giyQojM6DkyXVYigNo72p 
a, Y, Rihanna     , 2012, Unapologetic          , spotify:album:1ciAVKFdlpLi2eGDlXv6Bo 
a, N, Rihanna     , 2012, Unapologetic          , spotify:album:1jlYso6n0IxsGTLIvZOXUn 
a, N, Rihanna     , 2012, Unapologetic          , spotify:album:5UDXzVwWnn3mDy3mTpQPYb 

HELP请,这是一个巨大的令人失望。我在这里完全丧失了如何去获得任何可靠的名单,但我相信,如果官方客户可以做到这一点,那么我也可以。我一直在盯着这么多天,我正在考虑通过调用web-api来支持我的搜索,并使用web-api为我提供专辑列表给艺术家......听起来真的很不愉快虽然。否则,图书馆一直很乐意与之合作。再次感谢你的帮助!

回答

0

问题可能在于,有相同的专辑,但在不同的地区。我假设桌面客户端排序是基于区域的列表。

您可能需要检查SPArtistBrowse中的available属性。

相关问题