mirror of
https://github.com/nubenetes/awesome-kubernetes.git
synced 2026-07-28 09:32:20 +00:00
fix: stop YouTube mosaic from rendering the entire inventory (index outage)
load_inventory_channels() selected entries via 'youtube_mosaic' in entry
(key presence). save_inventory() always writes a youtube_mosaic column
that the SQL round-trip materializes as an empty dict {} on EVERY entry,
so the filter matched all 18,647 inventory entries and emitted ~18.6k
inline <img> links on a single line. That produced a 4MB v2-docs/index.md
(and 2.9MB docs/index.md), hanging both V1 and V2 index pages in the
browser. A prior revert masked it; the next SQL-backed sync re-broke it.
Fix: only treat an entry as a mosaic channel when youtube_mosaic is a
non-empty dict with a logo image (136 curated channels). Regenerated both
index files via reorganize_mosaic — docs/index.md is now byte-identical
to the last known-good state (52KB); v2-docs/index.md back to 41KB.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user