aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/roster.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/roster.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/roster.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/roster.py b/packages/meshbay-node/src/meshbay_node/roster.py
index 91e18cd..d6dc769 100644
--- a/packages/meshbay-node/src/meshbay_node/roster.py
+++ b/packages/meshbay-node/src/meshbay_node/roster.py
@@ -664,6 +664,31 @@ class Roster:
await self.set_setting(group_id, self.SETTING_AUDIO_ROOT, path or "", set_by)
return path or ""
+ # Which folder(s) are the Photos app's entry points for this group —
+ # a *set*, unlike video_root/audio_root above: a photo library is
+ # routinely scattered across several unrelated folders (docs/photos.md
+ # §2.1), so there is no single natural root to pick. Stored the same way
+ # `enabled_apps` already is (json.dumps(sorted(...))). Empty/unset means
+ # nothing configured yet — same "show nothing until an operator has
+ # chosen" discipline video_root/audio_root already established, not
+ # "the whole group index".
+ SETTING_PHOTO_ROOTS = "photo_roots"
+
+ async def photo_roots(self, group_id: str) -> list[str]:
+ value = await self.get_setting(group_id, self.SETTING_PHOTO_ROOTS)
+ if value is None:
+ return []
+ try:
+ return list(json.loads(value))
+ except (ValueError, TypeError):
+ return []
+
+ async def set_photo_roots(self, group_id: str, roots: list[str],
+ set_by: str = "") -> list[str]:
+ await self.set_setting(group_id, self.SETTING_PHOTO_ROOTS,
+ json.dumps(sorted(roots)), set_by)
+ return roots
+
# 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