aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/daemon.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-08-24 15:57:41 +0200
committerChristophe Besson <cbesson@gmail.com>2026-08-24 15:57:41 +0200
commitc5585beab3d6adefaa2ef9444946dd3816960a7c (patch)
treea321e540c2db0458716d526e4a045fca123937b2 /packages/meshbay-node/src/meshbay_node/daemon.py
parent317f09328ed8bf20148b707470c9b0fe82e59575 (diff)
downloadmeshbay-c5585beab3d6adefaa2ef9444946dd3816960a7c.tar.gz
fix(node,hub): HEVC transcode fallback, live-add progress, per-group TMDB toggle
Three bugs found live testing the Videos app against a real HEVC/EAC3 show, plus a design change requested afterward: - Streaming always did "-c:v copy", which faithfully reports a source's real hev1 codec string but is unplayable in a browser with no HEVC decoder (most Chrome/Linux builds). The node now transcodes to H264 whenever the probed codec is browser-incompatible (media_probe.py's new BROWSER_INCOMPATIBLE_VIDEO_CODECS), with a `transcode_incompatible_video` node.toml opt-out for operators who know their viewers already decode it. - Dropping a whole season into an already-watched folder gave no scanning indicator and no progress bar: IndexProgress was only ever updated by the two bulk scan paths, never by the real-time per-file watchdog path (_schedule_update/_debounce/_update_entry). That path now accounts a "burst" the same way, without double-counting a file rewritten mid-debounce. - A stray literal "0" rendered in the video detail modal when there was no TMDB match (`meta.confidence` is 0, and `0 && x` renders "0" in JSX/htm, not nothing) — `confident` is now a real boolean. - Whether TMDB is used at all moves from a node-wide setting to per-group (OP_TMDB_ENABLED/tmdb_enabled/tmdb_enabled_ack, scoped like OP_VIDEO_ROOT): an operator running a real media-library group alongside test/demo groups on one node wants outbound TMDB traffic for the one that needs it, not all of them. The custom API token and query language stay node-wide, one shared credential/cache (tmdb_config/OP_TMDB_CONFIG, unchanged reasoning). MNP_VERSION 0.6 -> 0.7, additive. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LAmyXtc6dAADsH23ydXQpY
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/daemon.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/daemon.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/daemon.py b/packages/meshbay-node/src/meshbay_node/daemon.py
index bf6bd64..7691467 100644
--- a/packages/meshbay-node/src/meshbay_node/daemon.py
+++ b/packages/meshbay-node/src/meshbay_node/daemon.py
@@ -334,6 +334,12 @@ class NodeDaemon:
# group — "" means the whole group index.
"video_root": await self._roster.video_root(
group_cfg.id) if self._roster else "",
+ # Whether TMDB lookups run for this group at all —
+ # per-group (2026-08-24, used to be node-wide), same
+ # "read once, kept current in place by the signed op"
+ # shape as video_root above.
+ "tmdb_enabled": await self._roster.tmdb_enabled(
+ group_cfg.id) if self._roster else True,
}
if not groups_ctx:
@@ -364,13 +370,14 @@ class NodeDaemon:
await self._media_cache.open()
self._enricher = Enricher(self._media_cache)
self._tmdb_client = TmdbClient(roster=self._roster)
- # Read once at load, like member_upload/enabled_apps — kept
- # current in place by ops.set_tmdb_config (the signed op),
- # exposed to every group's handshake ack via `daemon_state`
- # (already wired to self._webrtc._ctx below) since this is
- # node-wide, not per-group.
- tmdb_enabled, tmdb_token, tmdb_language = await self._roster.tmdb_config()
- self._state["tmdb_enabled"] = tmdb_enabled
+ # Token/language only — read once at load, kept current in place
+ # by ops.set_tmdb_config (the signed op), exposed to every
+ # group's handshake ack via `daemon_state` (already wired to
+ # self._webrtc._ctx below) since these stay node-wide, one
+ # shared credential/cache. Whether TMDB is used at all is now
+ # per-group instead — see each group's own "tmdb_enabled" in
+ # groups_ctx above.
+ tmdb_token, tmdb_language = await self._roster.tmdb_config()
self._state["tmdb_token_customized"] = bool(tmdb_token)
self._state["tmdb_language"] = tmdb_language or ""
log.info("Media cache opened: %s", media_cache_db)
@@ -390,6 +397,7 @@ class NodeDaemon:
groups=groups_ctx,
denylist=denylist,
max_concurrent_streams=self._config.node.max_concurrent_streams,
+ transcode_incompatible_video=self._config.node.transcode_incompatible_video,
)
# No global chat_store here: each group's store lives in
# groups_ctx[gid]["chat_store"] and is resolved per session via
@@ -721,6 +729,9 @@ class NodeDaemon:
"video_root": (
await self._roster.video_root(group_cfg.id)
if self._roster else ""),
+ "tmdb_enabled": (
+ await self._roster.tmdb_enabled(group_cfg.id)
+ if self._roster else True),
"chat_store": store,
}
groups_ctx[group_cfg.id] = new_ctx