【问题标题】:Getting track listing for an album?获取专辑的曲目列表?
【发布时间】:2015-03-28 03:11:19
【问题描述】:

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", 

遗憾的是,这只会让您获得每首曲目的密钥。

在一个请求中获取给定专辑曲目的标题(以及其他相关信息,如果可能)的最佳方式是什么?

【问题讨论】:

    标签: rdio


    【解决方案1】:

    您正在寻找的是extras 字段的使用。我有点惊讶album pages 没有列出它,但是有一个额外的“曲目”。它会在您的结果中添加一个“轨道”数组,其中包含所有基本轨道信息(包括“名称”)。

    【讨论】:

      猜你喜欢
      • 2015-02-20
      • 1970-01-01
      • 1970-01-01
      • 2012-05-10
      • 2015-05-23
      • 1970-01-01
      • 2023-04-04
      • 1970-01-01
      • 2013-12-26
      相关资源
      最近更新 更多