victor HF Staff commited on
Commit
be70eae
·
1 Parent(s): dbf9e08

fix: check actual thumb.png file instead of has_thumb metadata flag

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- if meta.get("has_thumb"):
 
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: