使用对 SPPlaylistFolder 的folderId 引用
我希望能够在特定的播放列表文件夹(也是由我的应用程序创建)中自动创建播放列表。
为了做到这一点,我想保存对创建的 SPPlaylistFolder
的引用,并能够稍后访问它(即添加播放列表 2 – n 时)。
查看CocoaLibSpotify文档,似乎使用folderId
属性是一种方法。但文档还指出:
重要提示:仅当您计划直接使用 C 时才应使用此选项 LibSpotify API。 CocoaLibSpotify 的行为是未定义的,如果您 直接在具有 CocoaLibSpotify 对象的项目上使用 C API 与他们相关。
我不太确定如何解释这一点...只需查看 folderId
属性及其相关方法(例如 -playlistFolderForFolderId:inContainer:
),似乎好像可以做我想做的事?或者我错过了什么?
I want to be able to automatically create playlists in an specific playlist folder (also created by my app).
In order to do this, I'd like to save a reference to a created SPPlaylistFolder
and be able to access it later (i.e. when adding playlists 2 – n).
Looking at the CocoaLibSpotify docs, it seems like using the folderId
property would be a way of doing it. But the docs also state:
Important: This should only be used if you plan to directly use the C
LibSpotify API. The behaviour of CocoaLibSpotify is undefined if you
use the C API directly on items that have CocoaLibSpotify objects
associated with them.
I'm not exactly sure how to interpret this... Just looking at the folderId
property and the methods related to it (e.g. -playlistFolderForFolderId:inContainer:
), it seems like it's possible to do what I want? Or am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以毫无问题地使用
SPPlaylistFolder
的folderId
属性。但是,当 Spotify 客户端重命名文件夹时,folderId 将会更改。目前似乎没有一种有效的方法可以通过重命名和在会话之间移动来跟踪文件夹。我们正在积极解决这个问题,但与此同时,您必须对folderId 和名称进行最佳尝试。
You can use the
folderId
property ofSPPlaylistFolder
without problems. However, when the Spotify client renames a folder, the folderId will change.At the moment there doesn't appear to be a valid way of tracking folders through renames and moves between sessions. We're actively working on this, but in the meantime you'll have to use a best-attempt against folderId and name.