Chrunos commited on
Commit
010751a
·
verified ·
1 Parent(s): 3a475f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -230,13 +230,13 @@ def download_track(request: Request, download_request: DownloadRequest):
230
 
231
  # Pydantic model for album request
232
  class AlbumRequest(BaseModel):
233
- album_id: str
234
 
235
 
236
  # Fetch album data
237
  @app.post("/z_album")
238
  def fetch_album(request: AlbumRequest):
239
- album_id = request.album_id
240
  try:
241
  response = requests.get(f"{DEEZER_API_URL}/album/{album_id}")
242
  response.raise_for_status()
@@ -262,13 +262,13 @@ def fetch_album(request: AlbumRequest):
262
 
263
  # Pydantic model for playlist request
264
  class PlaylistRequest(BaseModel):
265
- playlist_id: str
266
 
267
 
268
  # Fetch playlist data
269
  @app.post("/z_playlist")
270
  def fetch_playlist(request: PlaylistRequest):
271
- playlist_id = request.playlist_id
272
  try:
273
  response = requests.get(f"{DEEZER_API_URL}/playlist/{playlist_id}")
274
  response.raise_for_status()
 
230
 
231
  # Pydantic model for album request
232
  class AlbumRequest(BaseModel):
233
+ id: str
234
 
235
 
236
  # Fetch album data
237
  @app.post("/z_album")
238
  def fetch_album(request: AlbumRequest):
239
+ album_id = request.id
240
  try:
241
  response = requests.get(f"{DEEZER_API_URL}/album/{album_id}")
242
  response.raise_for_status()
 
262
 
263
  # Pydantic model for playlist request
264
  class PlaylistRequest(BaseModel):
265
+ id: str
266
 
267
 
268
  # Fetch playlist data
269
  @app.post("/z_playlist")
270
  def fetch_playlist(request: PlaylistRequest):
271
+ playlist_id = request.id
272
  try:
273
  response = requests.get(f"{DEEZER_API_URL}/playlist/{playlist_id}")
274
  response.raise_for_status()