Merge pull request #379 from nubenetes/fix/mosaic-runaway-index

fix: stop YouTube mosaic from rendering the entire inventory (index outage)
This commit is contained in:
Inaki
2026-06-19 15:24:22 +02:00
committed by GitHub
3 changed files with 22 additions and 1695 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -18,16 +18,24 @@ def load_inventory_channels():
channels = []
for url, entry in inventory.items():
if isinstance(entry, dict) and 'youtube_mosaic' in entry:
metadata = entry['youtube_mosaic']
channels.append({
'title': entry.get('title', 'Unknown Channel'),
'url': url,
'image': metadata.get('image', ''),
'category': metadata.get('category', 'learning_influencers_communities'),
'order_v1': metadata.get('order_v1', 9999),
'order_v2': metadata.get('order_v2', 9999)
})
if not isinstance(entry, dict):
continue
metadata = entry.get('youtube_mosaic')
# Every inventory entry carries a 'youtube_mosaic' column that the SQL
# round-trip materializes as an empty dict {}, so a bare key-presence
# check matches the entire inventory and explodes the mosaic to ~18k
# logos. Only treat an entry as a mosaic channel when it actually has
# mosaic metadata with a logo image.
if not isinstance(metadata, dict) or not metadata.get('image'):
continue
channels.append({
'title': entry.get('title', 'Unknown Channel'),
'url': url,
'image': metadata.get('image', ''),
'category': metadata.get('category', 'learning_influencers_communities'),
'order_v1': metadata.get('order_v1', 9999),
'order_v2': metadata.get('order_v2', 9999)
})
return channels
def build_v2_mosaic_markdown_from_channels(channels):

File diff suppressed because one or more lines are too long