modified: app.py
modified: locales/de-DE.json modified: locales/en-EN.json modified: templates/playlists.html
This commit is contained in:
10
app.py
10
app.py
@@ -103,6 +103,12 @@ def callback():
|
|||||||
code = request.args.get('code')
|
code = request.args.get('code')
|
||||||
token_info = sp_oauth.get_access_token(code)
|
token_info = sp_oauth.get_access_token(code)
|
||||||
session["token_info"] = token_info
|
session["token_info"] = token_info
|
||||||
|
|
||||||
|
# Hole User-Infos und speichere sie in der Session
|
||||||
|
sp = spotipy.Spotify(auth=token_info['access_token'])
|
||||||
|
user = sp.current_user()
|
||||||
|
session["user"] = user
|
||||||
|
|
||||||
return redirect("/playlists")
|
return redirect("/playlists")
|
||||||
|
|
||||||
@app.route("/playlists")
|
@app.route("/playlists")
|
||||||
@@ -266,8 +272,8 @@ def toggle_playback():
|
|||||||
|
|
||||||
@app.route('/logout')
|
@app.route('/logout')
|
||||||
def logout():
|
def logout():
|
||||||
session.pop('user', None)
|
session.clear()
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('home'))
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def index():
|
def index():
|
||||||
|
|||||||
@@ -36,5 +36,6 @@
|
|||||||
"artist": "Künstler",
|
"artist": "Künstler",
|
||||||
"album": "Album",
|
"album": "Album",
|
||||||
"year": "Jahr",
|
"year": "Jahr",
|
||||||
"open_on_spotify": "Auf Spotify öffnen"
|
"open_on_spotify": "Auf Spotify öffnen",
|
||||||
|
"logout": "Abmelden"
|
||||||
}
|
}
|
||||||
@@ -36,5 +36,6 @@
|
|||||||
"artist": "Artist",
|
"artist": "Artist",
|
||||||
"album": "Album",
|
"album": "Album",
|
||||||
"year": "Year",
|
"year": "Year",
|
||||||
"open_on_spotify": "Open on Spotify"
|
"open_on_spotify": "Open on Spotify",
|
||||||
|
"logout": "Logout"
|
||||||
}
|
}
|
||||||
@@ -54,6 +54,9 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<a href="{{ url_for('logout') }}" class="logout-btn" style="position:absolute;top:20px;right:30px;">
|
||||||
|
{{ translations['logout'] if translations['logout'] else 'Logout' }}
|
||||||
|
</a>
|
||||||
<div class="playlist-container">
|
<div class="playlist-container">
|
||||||
<h2>{{ translations['choose_playlist'] }}</h2>
|
<h2>{{ translations['choose_playlist'] }}</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user