コード例 #1
0
ファイル: utils.py プロジェクト: dlevylambert/project2-pd6
def build_artist(artist):
    releases = musicservices.getReleasesByID(
        musicservices.getID(artist))["releases"]
    return [
        musicservices.getName(artist)
        ,musicservices.getProfile(artist)
        ,musicservices.getMembers(artist)
        ,musicservices.getID(artist)
        ,releases
]
コード例 #2
0
ファイル: app.py プロジェクト: dlevylambert/project2-pd6
def login(username):
	global current_user
	global current_artist
	global current_artistID
	utils.connect()
	if request.method == "GET":
		songs = utils.get_songs(current_user)		
		current_user=session["user"]
		return render_template("login.html",user=current_user,songs=songs)
	else:
		button = str(request.form["button"])
		if button == "Close account":
			utils.remove_user(current_user)
			return redirect("/")
		elif button == "Search":
			current_artist = request.form.get("search")
			current_artistID = str(musicservices.getID(
					musicservices.getArtistInfo(
						utils.curate(current_artist))))
			session["artist"]=current_artist
			session["aID"]=current_artistID
			return redirect("/"+current_user+"/"+current_artistID)