MIDI hold and auto-fix move a link joined by name to the owning Mac's wired address

- WS 2026-10-21: FOH Mac mini joined ProPresenter's session by name; hold said "no automatic fix". Now the
  address comes from the link's own check, else the Mac that owns that session (wired SSH / ingest address +
  session port); auto-fix does it too, never while a HyperDeck records
- WS: FOH Mac mini <-> ProPresenter watched (FOH PROP); auto-fix moved it to 10.2.1.12:5004 by itself

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 20:52:42 -04:00
co-authored by Claude Opus 5.5
parent af4bfc868d
commit 51a14140cc
3 changed files with 75 additions and 6 deletions
+30 -5
View File
@@ -687,6 +687,27 @@ def by_name(address):
return str(address or "").startswith("\t")
def owner_wired_address(cfg, snap, session_name, nets):
""""ip:port" of the Mac whose network MIDI session is called `session_name`, at its wired address:
this Mac (its wired ingest address), or another computer the settings know (its SSH address), using
that session's own port. None when no known Mac owns it or none of its addresses is wired."""
def wired(ip):
try:
return any(ipaddress.ip_address(ip) in n for n in nets)
except ValueError:
return False
if snap.midi and session_name in snap.midi:
ip = next((i for i in (cfg.get("site") or {}).get("ingest_ips") or [] if wired(i)), None)
if ip:
return "%s:%s" % (ip, snap.midi[session_name].get("port") or 5004)
for alias, sessions in (snap.remote_midi or {}).items():
if session_name in (sessions or {}):
ip = str((cfg.get("hosts") or {}).get(alias, {}).get("ssh", "")).split("@")[-1]
if wired(ip):
return "%s:%s" % (ip, sessions[session_name].get("port") or 5004)
return None
def wired_nets(cfg):
"""The wired network(s) the MIDI key's wired check names (empty: no rule)."""
nets = []
@@ -1602,16 +1623,20 @@ class Engine:
target = chk["conn"]
if fix_kind == "midi_connect" and chk["type"] == "midi_wired":
# A peer off the wired network or joined by name: join it again at the wired
# address its own MIDI check names. One no check names (ProdDash's own) is left
# to its program: the key says which.
if errors_only:
continue # moving a working link drops it a second: a hold only
# address its own MIDI check names, else at the wired address of the Mac whose
# session it is (WS, 2026-10-21: FOH Mac mini joined ProPresenter by name and a hold
# did nothing). Moving a working link drops it for a second: auto-fix does it too,
# but never while a HyperDeck records. A peer no known Mac owns (ProdDash's own) is
# left to its program: the key says which.
if errors_only and self.any_recording:
continue
host, session, peer = (sub.split("|", 2) + ["", ""])[:3]
nets = wired_nets(self.cfg)
want = next((c.get("address") for t2 in all_tiles(self.cfg) for c in t2.get("checks", [])
if c.get("type") == "midi_peer" and c.get("host", "") == host and c.get("session") == session
and c.get("peer") == peer and peer_ip(c.get("address")) is not None
and any(peer_ip(c["address"]) in n for n in nets)), None)
and any(peer_ip(c["address"]) in n for n in nets)), None) \
or owner_wired_address(self.cfg, snap, peer, nets)
if not want:
continue
chk = dict({"host": host} if host else {}, type="midi_peer", session=session, peer=peer, address=want, repoint=True)