tecuts commited on
Commit
3e5eeb6
·
verified ·
1 Parent(s): 683494d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -81,8 +81,10 @@ def download_spotify_track(track_id: str):
81
  downloaded_files = os.listdir("downloads")
82
  logger.info(f"Files in downloads directory: {downloaded_files}")
83
 
84
- # Find the file that matches the track ID
85
- matching_files = [file for file in downloaded_files if track_id in file]
 
 
86
 
87
  if not matching_files:
88
  raise HTTPException(status_code=500, detail="File download failed")
 
81
  downloaded_files = os.listdir("downloads")
82
  logger.info(f"Files in downloads directory: {downloaded_files}")
83
 
84
+ # Fetch track metadata from Spotify (if needed)
85
+ # For now, assume the file is named like "Artist - Track Title.mp3"
86
+ # Look for files that match the pattern
87
+ matching_files = [file for file in downloaded_files if file.endswith(".mp3")]
88
 
89
  if not matching_files:
90
  raise HTTPException(status_code=500, detail="File download failed")