Skip to content

Commit

Permalink
update app
Browse files Browse the repository at this point in the history
  • Loading branch information
noeminellen committed Oct 23, 2022
1 parent 8cc7d06 commit 307f1fe
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions backend/src/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from flask import Flask, redirect, url_for
from backend.src.spotify_api.api_interface import SPOTIFY_API_INTERFACE
import pandas as pd
import numpy as np

app = Flask(__name__)
app.debug = True
Expand All @@ -15,18 +17,12 @@ def index():

@app.route('/current_info')
def current_info():
data = sp.get_current_song()
dict = data.to_dict()
return {'data': dict}, 200 # return data and 200 OK code

@app.route('/skipped_songs')
def skipped_song():
data = sp.get_current_song()
dict = data.to_dict()
data = sp.get_metadata_current()
if data is not None:
dict = data.to_dict()
else:
dict = pd.Series()
return {'data': dict}, 200 # return data and 200 OK code

if __name__ == '__main__':
app.run(debug=True)



0 comments on commit 307f1fe

Please sign in to comment.