1

好的。这越来越疯狂了。我已经为此工作了几天,尝试了不同的奇怪事情。我想我昨晚做了一场关于 libSpotify 的噩梦,可能是我睡眠习惯的产物,但是,我离题了。

反正。让我们使用以下代码查找艺术家“The XX”。假设艺术家用艺术家“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,具体取决于专辑是否在我的会话所在区域可用( US),第三列是艺术家姓名,第五列是专辑年份,第六列是专辑名称,最后是专辑的 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 加载了所有专辑,我所在地区实际可用的两个专辑被列为不可用,只有一个被列为专辑。

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 与专辑的 Spotify URL,说它们在我的地区不可用,通过专辑.available,“美国”地区代码就在专辑结果页面的输出中来自网络 API。其次,我总是得到截然不同的结果。没有什么是一致的,有时 Red Hot Chili Peppers 的专辑“I'm With You”在我所在的地区显示为可用,有时在我所在的地区没有可用的专辑。如果有我所在地区不可用的专辑,有时会调用另一个waitUntiLoaded:调用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

请帮助,这是一个巨大的无赖。我真的完全不知道如何获得任何可靠的列表,尽管我相信如果官方客户可以做到,那么我也可以。我已经盯着这个看了很多天了,我正在考虑通过调用 web-api 来备份我的搜索,比如,使用 web-api 为我提供艺术家的专辑列表......听起来真的很不愉快尽管。否则,与图书馆合作非常愉快。再次感谢你的帮助!

4

1 回答 1

0

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

你可能需要检查available里面的财产SPArtistBrowse

于 2014-01-10T13:27:29.460 回答