获取专辑的曲目列表?
Getting track listing for an album?
Rdio API 仅通过 API 为曲目列表提供密钥。
比方说,如果使用艺术家密钥调用 Rdio 的 getAlbumsForArtist 方法,您可能会得到类似于以下的响应:
{
"status": "ok",
"result": [
{
"baseIcon": "album/a/8/2/000000000001e28a/1/square-200.jpg",
"releaseDate": "2007-07-10",
"artistUrl": "/artist/Justice/",
"duration": 2858,
"isClean": false,
"shortUrl": "http://rd.io/x/Qj5Dvck/",
"canStream": true,
"embedUrl": "https://rd.io/e/Qj5Dvck/",
"type": "a",
"price": "None",
"key": "a123530",
"icon": "http://img00.cdn2-rdio.com/album/a/8/2/000000000001e28a/1/square-200.jpg",
"canSample": true,
"name": "Justice",
"isExplicit": false,
"artist": "Justice",
"url": "/artist/Justice/album/Justice/",
"artistKey": "r80653",
"length": 12,
"trackKeys": [
"t1555455",
"t1555488",
"t1555527",
"t1555555",
"t1555583",
"t1555618",
"t1555640",
"t1555663",
"t1555693",
"t1555727",
"t1555762",
"t1555798"
],
"canTether": true,
"displayDate": "Jul 10, 2007"
},
{
"baseIcon": "album/f/2/d/0000000000451d2f/1/square-200.jpg",
"releaseDate": "2014-05-26",
遗憾的是,这只会让您获得每首曲目的钥匙。
在一次请求中获取给定专辑曲目的标题(以及其他相关信息,如果可能)的最佳方式是什么?
你要找的是 extras field. I'm kind of surprised that album pages 的用途 没有列出来,但是有一个 "tracks" 额外的。它将向您的结果添加一个 'tracks' 数组,其中包含所有基本曲目信息(包括 "name")。
Rdio API 仅通过 API 为曲目列表提供密钥。
比方说,如果使用艺术家密钥调用 Rdio 的 getAlbumsForArtist 方法,您可能会得到类似于以下的响应:
{
"status": "ok",
"result": [
{
"baseIcon": "album/a/8/2/000000000001e28a/1/square-200.jpg",
"releaseDate": "2007-07-10",
"artistUrl": "/artist/Justice/",
"duration": 2858,
"isClean": false,
"shortUrl": "http://rd.io/x/Qj5Dvck/",
"canStream": true,
"embedUrl": "https://rd.io/e/Qj5Dvck/",
"type": "a",
"price": "None",
"key": "a123530",
"icon": "http://img00.cdn2-rdio.com/album/a/8/2/000000000001e28a/1/square-200.jpg",
"canSample": true,
"name": "Justice",
"isExplicit": false,
"artist": "Justice",
"url": "/artist/Justice/album/Justice/",
"artistKey": "r80653",
"length": 12,
"trackKeys": [
"t1555455",
"t1555488",
"t1555527",
"t1555555",
"t1555583",
"t1555618",
"t1555640",
"t1555663",
"t1555693",
"t1555727",
"t1555762",
"t1555798"
],
"canTether": true,
"displayDate": "Jul 10, 2007"
},
{
"baseIcon": "album/f/2/d/0000000000451d2f/1/square-200.jpg",
"releaseDate": "2014-05-26",
遗憾的是,这只会让您获得每首曲目的钥匙。
在一次请求中获取给定专辑曲目的标题(以及其他相关信息,如果可能)的最佳方式是什么?
你要找的是 extras field. I'm kind of surprised that album pages 的用途 没有列出来,但是有一个 "tracks" 额外的。它将向您的结果添加一个 'tracks' 数组,其中包含所有基本曲目信息(包括 "name")。