aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/ops.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/ops.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/ops.py26
1 files changed, 9 insertions, 17 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/ops.py b/packages/meshbay-node/src/meshbay_node/ops.py
index c880c75..cb8e01e 100644
--- a/packages/meshbay-node/src/meshbay_node/ops.py
+++ b/packages/meshbay-node/src/meshbay_node/ops.py
@@ -326,7 +326,13 @@ async def list_groups(state: dict) -> dict:
"roots": roots.describe() if roots else [],
"peers": sum(1 for p in peers.values() if p.get("group_id") == gid),
})
- return {"groups": out}
+ roster = state.get("roster")
+ has_operator = False
+ if roster:
+ members = await roster.list_members()
+ has_operator = any(m["role"] == "operator" and m["status"] == "active"
+ for m in members)
+ return {"groups": out, "operator_paired": has_operator}
async def attach_group(state: dict, name: str, shared_dir: str,
@@ -783,22 +789,8 @@ async def set_tmdb_enabled(state: dict, group_id: str, enabled: bool) -> dict:
# ── MusicBrainz config (Music app) ───────────────────────────────────────────
-async def set_musicbrainz_config(state: dict, contact: str | None = None) -> dict:
- """
- The node-wide User-Agent contact string MusicBrainz's usage policy asks
- for (docs/musicbay.md §3.2). Unlike set_tmdb_config there is no token to
- manage — MusicBrainz's read endpoints need no credential — so this is a
- single field. `contact=""` explicitly clears a previously-set contact
- (reverting to "no calls at all", never a generic/unidentified
- User-Agent); `contact=None` leaves whatever was there unchanged.
- """
- roster = _roster(state)
- await roster.set_musicbrainz_contact(contact, set_by=state.get("node_user_id", ""))
- if contact is not None:
- state["musicbrainz_contact_configured"] = bool(contact)
- log.info("MusicBrainz config: contact_configured=%s", bool(contact))
- return {"contact_configured": state.get("musicbrainz_contact_configured", False)}
-
+# set_musicbrainz_config removed — MusicBrainz contact is now the owner's
+# hub email, resolved at login (daemon.py / musicbrainz.py).
async def set_musicbrainz_enabled(state: dict, group_id: str, enabled: bool) -> dict:
"""