The content store never shrinks on its own — deleting a save removes only tomls, never store audio (D7) — so unreferenced audio accumulates. The new /orphans provider surfaces it for reclamation (realizing store D10). It lists every store entry, walks the mounted file providers (the /crabidy tree and /fs) to cross off entries a Playable::Store toml still references, and presents the rest. Each orphan is an editable + deletable + queueable child node, so the existing e/d/queue gestures work unchanged — no proto, TUI, or web change. Rename moves both the audio file and its .cbd-store.toml sidecar (keeping the derived index in sync); delete removes both from disk; queueing plays straight from the store. Enumeration/rename/delete are CrabidyStore methods (it owns the store root and index); a thin OrphansProvider computes the reference roots and delegates. fsdy::Client gains a disk_root() accessor so the /fs root can be handed in as a reference root. Mounts only when the store is present. Includes the dev-flow artifacts (architecture/quality/plan) and docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
README.md
fsdy — the filesystem provider
Mounts a local directory at /fs in the crabidy library. The same
engine also powers the server-managed mounts /queues, /bookmarks,
and /captures — everything below applies to their on-disk format too.
How it works
The provider walks one configured root directory. Every directory
becomes a queueable library node; every file ending in
.cbd-track.toml becomes a track; everything else (audio files,
covers, hidden entries) is invisible to the library. Listing order is
case-insensitive by file name — prefix files with numbers to fix an
order (the capture/bookmark writers use 0001-style prefixes for
exactly this reason).
A track file carries the track's metadata plus a reference to the playable thing:
title = "We Will Rock You" # required
artist = "Queen" # optional
duration = 122 # optional, seconds
[album] # optional
title = "News of the World"
release_date = "1977-10-28"
# Exactly ONE of the following four:
[playable]
file = "we-will-rock-you.flac" # local audio; absolute, or relative to
# this file's directory (relocatable)
# url = "https://example.org/radio.mp3" # http(s) stream
# link = "/tidal/artists/1/2/3" # another provider's track
# skipped = true # no audio: a capture recorded its
# source as uncapturable; shown red,
# skipped by playback
Malformed track files are skipped with a warning; they never break the
listing. link playables resolve exactly one hop (a link to a link
fails at play time), which keeps cycles impossible.
Configuration — ~/.config/crabidy/fsdy.toml
# Absolute path of the directory to expose under /fs.
# Default: the platform music directory (e.g. ~/Music). When neither is
# available the /fs mount is disabled — the rest of the server runs on.
# root = "/home/me/music"
The server-managed instances
/queues, /bookmarks, and /captures are fsdy instances over
~/.config/crabidy/{queues,bookmarks,captures}/, written by the server
(queue persistence, w, W) and readable/editable with any file
manager — they are just folders of the track files described above.
Their top-level folders can be renamed (e) and deleted (d) from the
TUI; /queues/current is the continuously persisted play queue and is
protected.
/captures additionally lets d delete anything in its tree — a
whole capture, a nested album folder, or a single track (which takes
its downloaded audio file with it). Because that removes data from
disk that was slow to download, the TUI asks for confirmation first
(delete <name>? [y/N]); deletes elsewhere stay unconfirmed.