sp_user_display_name always returns canonical name, even when user is loaded

旧街凉风 提交于 2019-12-13 06:42:48

问题


Hello Spotify community =) I've been beating my head against this for a while. When I ask libspotify for the owner of a playlist via sp_playlist_owner, I am never able to get the user's display name out from sp_user_display_name.

In the API, it mentions that the display name is only available after the user has been loaded. Specifically, this should be when sp_user_is_loaded returns true. However, I have found this to not be the case.

I have hooked into every available playlist callback in an attempt to catch when the user is loaded, and then output both the canonical and display names. I am doing this for a playlist where I know the canonical and display names of the owner are different.

  • In the case of a fresh start (deleting the settings directory before invoking sp_session_create), I initially get the Spotify log message UserCache::initiateGetUsers() will query for 1 users. Subsequent callbacks then indicate that the user has been loaded, but the canonical name is always returned.

  • In the case of a restart (where the playlist data is loaded from disk), I don't get the log message mentioned above, and the user is initially indicated as loaded. But again, the same problem. I am only ever given the canonical username.

Is this a bug in the API, or am I missing something?


回答1:


I believe that the full display name is only available in libspotify for the currently logged-in user, and then only if they logged in with Facebook credentials.



来源:https://stackoverflow.com/questions/23797162/sp-user-display-name-always-returns-canonical-name-even-when-user-is-loaded

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