spotify-app

Code inside while loop not being executed JavaScript

一个人想着一个人 提交于 2021-01-28 06:48:04
问题 I am working with this while loop and it is not working. I decided to use the Google Chrome debugger and I saw that the code inside is not being executed. All the time it checks the condition, starts the first line of the code inside, and goes back again to check the condition. It is a NodeJS server and I am using the Spotify API. app.get('/process', ensureAuthenticated, function (req, res) { let init_array = text.split(" "); let modtext = init_array; while (init_array.length != 0) {

Intermittent issue with tracks snapshot for current user top list

↘锁芯ラ 提交于 2020-01-25 17:25:57
问题 I have a problem when executing this code: require(['$api/models','$api/library#Library'], function(models,Library) { // THIS ONLY HAPPEN FOR TOP LIST var uri=Library.forCurrentUser().toplist.uri; // IF YOU USE ANY OTHER PLAYLIST IT WORKS FINE // var uri="spotify:user:vdesabou:playlist:0xy2zExFmPzJZsY0X0bCC5"; var playlist = models.Playlist.fromURI(uri); playlist.load('tracks').done(function() { console.log("loaded 1"); playlist.tracks.snapshot().done(function(snapshot) { console.log(

Intermittent issue with tracks snapshot for current user top list

北慕城南 提交于 2020-01-25 17:24:47
问题 I have a problem when executing this code: require(['$api/models','$api/library#Library'], function(models,Library) { // THIS ONLY HAPPEN FOR TOP LIST var uri=Library.forCurrentUser().toplist.uri; // IF YOU USE ANY OTHER PLAYLIST IT WORKS FINE // var uri="spotify:user:vdesabou:playlist:0xy2zExFmPzJZsY0X0bCC5"; var playlist = models.Playlist.fromURI(uri); playlist.load('tracks').done(function() { console.log("loaded 1"); playlist.tracks.snapshot().done(function(snapshot) { console.log(

Spotify Clear Playlist Drag and Drop

对着背影说爱祢 提交于 2019-12-24 13:11:54
问题 When you drag/drop an Artist into my app in the sidebar, I build a temporary playlist. Every time I drag a new Artist into my app, it builds a new list after the previous, WITHOUT clearing out the old one. (Note there is some code missing from here that is probably not needed). My question: how do I clear out or remove the current built playlist THEN build a new one, every time I drag/drop an Artist into my app? I suspect it would need to be called inside getRelated()? models.application

Custom Web Player for Spotify

浪尽此生 提交于 2019-12-14 01:31:25
问题 As far as I know, it is not possible to develop a Web app (outside spotify.com) providing a custom Web player which plays Spotify songs, am I right? The only option still seems to be the spotify play button, which is very limited though. I have just seen, however, this example 1) http://static.echonest.com/enspex/web/ChillRadio/ this one 2) http://lab.possan.se/thirtify/ and this one 3) https://developer.spotify.com/web-api/code-examples/ (see "Play something" snippet) that seems to use a

Cannot load external API's in index.html

吃可爱长大的小学妹 提交于 2019-12-13 04:33:33
问题 I am trying to run the following code in Spotify apps but gapi.client is considered undefined. I do not have this problem when running in chrome. Does anyone know why or how this is happening. <!doctype html> <html> <head> <title>Vidify</title> </head> <body> <!--Add a button for the user to click to initiate auth sequence --> <button id="authorize-button" style="visibility: hidden">Authorize</button> <script type="text/javascript"> var clientId = '591751286145

launchWebAuthFlow with Spotify returns “Authorization page could not be loaded”

天涯浪子 提交于 2019-12-10 13:09:50
问题 I registered my app on Spotify. I made sure I had the URI added to my registered app. But still every time I run this code I keep getting the same error. I am also running this in the background so I know it's not that. What am I doing wrong? Also I tried switching /spotify with /provider_cb . var client_id = '<my_client_id>'; var redirectUri = chrome.identity.getRedirectURL() + "/spotify"; chrome.identity.launchWebAuthFlow({ "url": "https://accounts.spotify.com/authorize?client_id="+client

Spotify API Create Temp Playlist Not Loading

大兔子大兔子 提交于 2019-12-09 19:04:57
问题 I'm making a little app that displays a list of the top first song of an artist's related artists. When I try and load my app for the first time, it shows nothing. But, when I "Reload Application" everything seems to work. When I constantly start "Reloading" it keeps adding more of the same tracks to the list as well. How do I stop it from continually appending more tracks to the list as well as tighten up the code so that it works on load? require([ '$api/models', '$views/list#List', '$api

Spotify create playlist and add tracks

放肆的年华 提交于 2019-12-08 12:09:54
问题 I am trying to add a "save as playlist" button to my app API 1.0. Can someone help me figure out what is wrong here? var player_obj = models.Album.fromURI('spotify:album:7o7UHh5PfO1kY4YoxqrwN7'); player_obj.load('tracks').done(function(a){ var saved_playlist = new models.Playlist.create(player_obj.name); console.log(saved_playlist); a.tracks.snapshot().done(function(snapshot){ for (var i = 0, l = snapshot.length; i < l; i++) { var track = snapshot.get(i); saved_playlist.add(track); } }); });

Get play count of a track from Spotify API

夙愿已清 提交于 2019-12-06 17:48:16
问题 Is it possible to get the play count of a song (for the current user)? I only found Toplist and the Track class, but neither tells me how often a user listened to a song. 回答1: As far as I know there is no way to retrieve that data at the moment. 回答2: This is not possible through the Spotify API right now. The Last.fm API does offer information similar to this, as a potential work-around. 回答3: Marked as not right now on the Spotify support site. http://community.spotify.com/t5/Spotify-Ideas