aggiunta .json() nei return degli endpoint

This commit is contained in:
AnouarElKihal 2025-08-02 05:17:33 +02:00
parent 564a2a4b9a
commit 502959d83b

View file

@ -54,7 +54,7 @@ def search(query: str):
"Authorization": "Bearer " + SessionManager.instance().get_current_session().access_tokens,
"Content-Type": "application/json"
}
return requests.get(url, headers=header)
return requests.get(url, headers=header).json()
except Exception as e:
print(e)
@ -66,7 +66,7 @@ def play(song_id: str):
"Authorization": "Bearer " + SessionManager.instance().get_current_session().access_tokens,
"Content-Type": "application/json"
}
requests.put(url, data=body, headers=header)
requests.put(url, data=body, headers=header).json()
@music_router.get("/current-song")
def current_song():
@ -75,5 +75,5 @@ def current_song():
"Authorization": "Bearer " + SessionManager.instance().get_current_session().access_tokens,
"Content-Type": "application/json"
}
return requests.get(url, headers=header)
return requests.get(url, headers=header).json()