Random mode: hide cards and add Delete for empty folders
Summary
When Random mode picks an album whose folder has no audio files, hide the Tracklist, Recommendation, and Organize cards (they have no useful job to do) and replace them with a small empty-state. A red Delete button appears to the left of Skip in the hero — confirming the existing DeleteConfirmDialog calls DELETE /api/albums/[id] (which removes the folder from disk + DB via the existing deleteAlbum service) and then loads the next random album.
Motivation: as the sort backlog drains, source subfolders are emptying out and Random keeps picking them. Skip alone leaves them behind to be hit again.
All changes are in src/routes/random/+page.svelte. No backend changes — the delete endpoint and confirmation dialog are reused as-is.
Test plan
-
pnpm run buildpasses with no new warnings -
Navigate to /randomand skip until an empty folder is picked-
Tracklist, Recommendation, Organize cards are hidden; empty-state message shows -
Delete appears to the left of Skip -
Click Delete → confirm dialog → confirm → toast "Folder deleted", folder gone from disk, next random album loads -
Cancel in the dialog → no deletion, album still shown
-
-
Sanity-check a non-empty random album still renders all three cards and has no Delete button