From 665fb2004e55b72ea483aa50fea81f6a6fd9c322 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Mon, 24 Aug 2026 22:24:52 +0200 Subject: feat(node): add audio_root, gate Music enrichment on it like video_root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit musicbay.md's original call — Music needs no root, tag reads are cheap so just cover the whole shared tree — didn't hold up against a real messy library: everything under every shared folder got mixed together with no way to scope Music down to an actual music collection. This adds an audio_root setting, symmetric to video_root in every respect: signed operator op (audio_root/audio_root_ack, MNP bumped to 0.10), validated against a real directory in the group's own roots before a signature is even asked for, gates tag/cover enrichment exactly like video_root gates ffprobe/TMDB (nothing runs until it's set, only files under it once it is), and a set/change fires a one-off sweep of whatever the folder already contains. The old trigger — sweep everything the instant "music" joins enabled_apps — is gone along with the root-less design it belonged to; setting audio_root is now the trigger, mirroring set_video_root's enrich_video_root_fn exactly. Test coverage mirrors the video_root suite: policy (refuse before a signature round trip, accept/store correctly) and the enrichment gate itself (nothing without a root, only files under it, sweep on set). --- packages/meshbay-node/src/meshbay_node/roster.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'packages/meshbay-node/src/meshbay_node/roster.py') diff --git a/packages/meshbay-node/src/meshbay_node/roster.py b/packages/meshbay-node/src/meshbay_node/roster.py index 24424ab..91e18cd 100644 --- a/packages/meshbay-node/src/meshbay_node/roster.py +++ b/packages/meshbay-node/src/meshbay_node/roster.py @@ -649,6 +649,21 @@ class Roster: await self.set_setting(group_id, self.SETTING_VIDEO_ROOT, path or "", set_by) return path or "" + # Same shape as SETTING_VIDEO_ROOT — the Music app's own entry point, + # added later (docs/musicbay.md's original "no root, works over the + # whole shared tree" simplification turned out not to hold up against a + # real messy library: the operator asked for the same scoping Videos + # already had). Empty/unset means Music shows nothing yet, exactly like + # an unset video_root — see daemon.py's enrichment gate. + SETTING_AUDIO_ROOT = "audio_root" + + async def audio_root(self, group_id: str) -> str: + return await self.get_setting(group_id, self.SETTING_AUDIO_ROOT, "") or "" + + async def set_audio_root(self, group_id: str, path: str, set_by: str = "") -> str: + await self.set_setting(group_id, self.SETTING_AUDIO_ROOT, path or "", set_by) + return path or "" + # Whether TMDB lookups run for this group at all — per-group, unlike the # token/language above: one node process can share a real media library # group and several test/demo groups, and outbound TMDB traffic (and API -- cgit v1.2.3