好。这变得疯狂了。我一直在研究这个问题几天尝试不同的奇怪事情。我想我昨晚有一个关于libSpotify的噩梦,可能是我睡眠习惯的产物,但是,我离题了。
反正。让我们用以下代码查找艺术家“The XX”。假设 artist 使用艺术家“the xx”初始化,Spotify url spotify:artist: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 =单曲,c =编辑,u =未知),第二列是Y或N,具体取决于相册是否在我的会话区域中可用(美国),第三列是艺术家名称,第五列是专辑的年份,第六列是专辑的名称,最后是专辑的Spotify URL。
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的所有相册之后,我所在地区可用的两个实际相册项目 all 也列为不可用,且仅限于一个实际列为专辑。
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
我该如何解决这个问题?很多时候,如果您使用相册的Spotify网址检查web-api,表明它们在我的地区通过album.available不可用,则“US”地区代码位于相册结果页面的输出中来自web-api。其次,我总是得到不同的结果。没有什么是一致的,有时Red Hot Chili Peppers的专辑“我和你在一起”出现在我的地区,有时我所在的地区没有。如果我所在的地区有相册,则有时会使用artistBrowse在 waitUntilLoaded 调用中返回的 loadedItems 调用另一个 waitUntiLoaded:调用。专辑解决了这个问题;再加载“装载物品”有时会缓解这个问题?这甚至没有意义。
最后,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
帮助请,这是一个巨大的无赖。我在这里完全失去了如何获得任何类可靠列表,尽管我确信如果官方客户能够做到,那么我也可以。我一直在盯着这几天,我正在考虑通过调用web-api来备份我的搜索,比如,使用web-api给我艺术家的专辑列表......听起来真的很不愉快虽然。否则,图书馆一直很愉快。再次感谢您的帮助!
答案 0 :(得分:0)
问题可能是相同的专辑,但在不同的地区。我假设桌面客户端排序是基于区域的列表。
您可能需要检查available
内的SPArtistBrowse
属性。