Editing Time Field in a Spotify App Playlist

跟風遠走 提交于 2019-12-12 04:58:19

问题


I am having trouble removing the time field from a playlist in the Spotify App. I only want to display Song title, Artist and Album. Any help on this topic would be truly helpful.


回答1:


You can specify which track attributes to display using the List object. An example is here: http://deceptacle.com/2011/12/26/spotify-app-api-some-things/

var list = new views.List(playlist, function (track) {
    return new views.Track(track, views.Track.FIELD.NAME |
                views.Track.FIELD.ARTIST |
                views.Track.FIELD.ALBUM);
});
$("#playlist").append(list.node);

Update

More fleshed out example:

var pl = m.Playlist.fromURI("spotify:user:rhino_records:playlist:6sSFeKDgDxVR81YqNOuPf2");
var list = new v.List(pl, function (track) {
    return new views.Track(track, views.Track.FIELD.NAME |
                views.Track.FIELD.ARTIST |
                views.Track.FIELD.ALBUM);
});

document.body.appendChild(list.node);

m is the models namespace, v is the views namespace. For some reason, it's not quite working for me. It seems like the observer methods aren't being called at the moment. Seems to be a spotify backend thing though. It seems to get called eventually after some prodding



来源:https://stackoverflow.com/questions/10097104/editing-time-field-in-a-spotify-app-playlist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!