aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node')
-rw-r--r--packages/meshbay-node/src/meshbay_node/enrichment.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/enrichment.py b/packages/meshbay-node/src/meshbay_node/enrichment.py
index 66b69b9..19aafba 100644
--- a/packages/meshbay-node/src/meshbay_node/enrichment.py
+++ b/packages/meshbay-node/src/meshbay_node/enrichment.py
@@ -217,6 +217,11 @@ class EnrichmentMixin:
actually photo albums would burn CPU on files never meant to be in
the Photos app at all. `_enriched_attempted` is shared with the
video/audio paths โ€” content-addressed ids never collide across them.
+
+ A video in a photo folder (a phone's clips, backed up beside its
+ photos, ยง9.12) is probed and thumbnailed by the video enricher, which
+ is all an album tile and the lightbox need. Nothing there looks it up
+ anywhere: matching is the Videos app's, asked by its own pages.
"""
if not self._photo_enricher or not self._roster:
return
@@ -224,7 +229,9 @@ class EnrichmentMixin:
if not photo_dirs:
return
for entry in entries:
- if entry.type != "image" or (indexer.group_id, entry.id) in self._enriched_attempted:
+ if entry.type not in ("image", "video") or (indexer.group_id, entry.id) in self._enriched_attempted:
+ continue
+ if entry.type == "video" and not self._enricher:
continue
if not _under_any_directory(entry.path, photo_dirs):
continue
@@ -236,7 +243,10 @@ class EnrichmentMixin:
async def on_done(file_id: str, fields: dict, _indexer=indexer) -> None:
await self._on_enriched(_indexer, file_id, fields)
- self._photo_enricher.spawn(entry, file_path, on_done)
+ if entry.type == "video":
+ self._enricher.spawn(entry, file_path, on_done)
+ else:
+ self._photo_enricher.spawn(entry, file_path, on_done)
async def _enrich_photo_roots_now(self, group_id: str) -> None:
"""
@@ -269,7 +279,7 @@ class EnrichmentMixin:
unchanged file is redundant work, not a correctness issue.
"""
for entry in updates:
- if entry.type != "image":
+ if entry.type not in ("image", "video"):
continue
old = previous.get_entry(entry.id)
if old is None or (old.name == entry.name and old.path == entry.path):