final commit
This commit is contained in:
parent
c35df24186
commit
63ee4b6ee1
1 changed files with 3 additions and 6 deletions
|
@ -1,14 +1,10 @@
|
||||||
import os
|
import os
|
||||||
import urllib.parse
|
|
||||||
from email import header
|
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from auth.session import SessionData, SessionManager
|
from auth.session import SessionData, SessionManager
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
from fastapi.responses import RedirectResponse
|
from fastapi.responses import RedirectResponse
|
||||||
|
|
||||||
from backend.endpoints.queue import delete_item
|
|
||||||
|
|
||||||
music_router = APIRouter(prefix="/music")
|
music_router = APIRouter(prefix="/music")
|
||||||
|
|
||||||
SPOTIFY_CLIENT_ID = os.getenv("SPOTIFY_CLIENT_ID")
|
SPOTIFY_CLIENT_ID = os.getenv("SPOTIFY_CLIENT_ID")
|
||||||
|
@ -58,7 +54,7 @@ def callback(code: str):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"changed": session != old_session,
|
"changed": session != old_session,
|
||||||
"access_token": session.access_token,
|
"access_token": session.access_token,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,7 +86,7 @@ def play(song_id: str):
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
}
|
}
|
||||||
print(body)
|
print(body)
|
||||||
response = requests.put(url,json=body, headers=header)
|
response = requests.put(url, json=body, headers=header)
|
||||||
|
|
||||||
return response.json()
|
return response.json()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -109,6 +105,7 @@ def current_song():
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
|
||||||
@music_router.get("/add_queue_track")
|
@music_router.get("/add_queue_track")
|
||||||
async def add_queue_track(song_id: str):
|
async def add_queue_track(song_id: str):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue