{"size": 1305, "ext": "js", "max_stars_repo_path": "api/menu_detail.js", "max_stars_repo_name": "JooZh/music-api-for-qq", "max_stars_repo_stars_event_min_datetime": "2019-03-12T16:57:59.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-15T11:55:25.000Z", "max_issues_repo_path": "api/menu_detail.js", "max_issues_repo_name": "JooZh/music-api-for-qq", "max_issues_repo_issues_event_min_datetime": "2020-07-17T10:29:36.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T12:15:16.000Z", "max_forks_repo_path": "api/menu_detail.js", "max_forks_repo_name": "JooZh/music-api-for-qq", "max_forks_repo_forks_event_min_datetime": "2019-04-28T12:16:07.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-14T03:23:23.000Z"}
{"max_stars_count": 18, "max_issues_count": 6, "max_forks_count": 4, "avg_line_length": 26.6326530612, "max_line_length": 72, "alphanum_fraction": 0.5877394636}
const {formatTime} = require('../utils/base');

const options = {
  disstid: 6916344291,
  onlysong: 0,
  type: 1,
  picSize:600
}
const config = {
  url:'https://c.y.qq.com/qzone/fcg-bin/fcg_ucc_getcdinfo_byids_cp.fcg',
  merge: (query,dotProp)=>{
    return Object.assign(options,query)
  },
  handle: (res,picSize) => {
    let data = res.cdlist[0]
    let newData = {
      info:{
        diss_name:data.dissname,
        diss_id:data.dissid,
        diss_desc:data.desc,
        diss_pic:data.logo.replace('/300?n=1',`/${picSize}?n=1`),
        nick_name:data.nickname || data.nick,
        tags:data.tags,
        song_num:data.songnum
      },
      song_list:data.songlist.map(item=>{
        return {
          song_id:item.songid,
          song_name: item.songname,
          song_mid:item.songmid,
          album_id:item.albumid,
          album_mid:item.albummid,
          album_name:item.albumname,
          album_desc:item.albumdesc,
          interval_num:item.interval,
          interval_str: formatTime(item.interval),
          mv_mid:item.vid,
          isonly:item.isonly,
          singers: item.singer,
          singer_name: item.singer.map(v=>v.name).join('/')
        }
      }),
      song_ids:data.songids.split(',')
    };
    return newData
  }
}

module.exports = config