def searchPage(): if 'access_token' not in session: return redirect(url_for('mainPage')) accessTok = session['access_token'] newClient = soundcloud.Client(access_token=accessTok) currentUser = newClient.get('/me') query = request.args.get('filterLikes') currentLikes = backend.searchLikes(query, currentUser.id, currentUser.username) currentTracks = backend.getTracks(newClient) return render_template('profile.html', user=currentUser, likes = currentLikes, tracks = currentTracks)
def profilePage(): if 'access_token' not in session: return redirect(url_for('mainPage')) accessTok = session['access_token'] newClient = soundcloud.Client(access_token=accessTok) backend.updateLikes(newClient) backend.updateTracks(newClient) currentLikes = backend.getLikes(newClient) #newClient.get('/me/favorites') currentTracks = backend.getTracks(newClient) #newClient.get('/me/tracks') currentUser = newClient.get('/me') followings = backend.getFollowings(newClient) countries = backend.tallyCountries(followings) return render_template('profile.html', user=currentUser, likes = currentLikes, tracks = currentTracks, countryTally = countries )