Spotify应用API - 播放列表订阅 [英] Spotify App API - Playlist Subscribe

查看:200
本文介绍了Spotify应用API - 播放列表订阅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

综观APP API,好像你都能够确定用户是否订阅到播放列表或没有。但是,我的应用程序需要用户能够订阅或从播放列表中取消订阅。

Looking at the APP API, it seems like you can determine whether or not a user is subscribed to a playlist or not. However, my app requires the user to be able to subscribe or un-subscribe from a playlist.

这可能使用JavaScript的应用程序API呢?

Is this possible using the Javascript App API at all?

推荐答案

有关在当前登录用户,您可以订阅,并通过设置播放列表的订阅属性从播放列表中取消。

For the currently logged in user you can subscribe and unsubscribe from a playlist by setting the playlist's subscribed property.

var m = sp.require('sp://import/scripts/api/models')
var playlist = m.Playlist.fromURI('spotify:user:<otherUser>:playlist:<playlist>')

playlist.subscribed

> false

playlist.subscribed = true
playlist.subscribed

> true

playlist.subscribed = false
playlist.subscribed

> false

这篇关于Spotify应用API - 播放列表订阅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆