Spaces:
Running on Zero
Running on Zero
fix: check actual thumb.png file instead of has_thumb metadata flag
Browse files
app.py
CHANGED
|
@@ -422,7 +422,8 @@ def _rebuild_feed() -> str:
|
|
| 422 |
with open(meta_path) as f:
|
| 423 |
meta = json.load(f)
|
| 424 |
meta["audio_url"] = f"{BUCKET_URL}/songs/{song_id}/{song_id}.wav"
|
| 425 |
-
|
|
|
|
| 426 |
meta["thumb_url"] = f"{BUCKET_URL}/songs/{song_id}/thumb.png"
|
| 427 |
songs.append(meta)
|
| 428 |
except Exception:
|
|
|
|
| 422 |
with open(meta_path) as f:
|
| 423 |
meta = json.load(f)
|
| 424 |
meta["audio_url"] = f"{BUCKET_URL}/songs/{song_id}/{song_id}.wav"
|
| 425 |
+
thumb_path = os.path.join(songs_dir, song_id, "thumb.png")
|
| 426 |
+
if os.path.isfile(thumb_path):
|
| 427 |
meta["thumb_url"] = f"{BUCKET_URL}/songs/{song_id}/thumb.png"
|
| 428 |
songs.append(meta)
|
| 429 |
except Exception:
|