Update app.py
Browse files
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 |
-
#
|
85 |
-
|
|
|
|
|
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")
|