mirror of
https://github.com/nubenetes/awesome-kubernetes.git
synced 2026-07-13 02:10:15 +00:00
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:
1685
docs/index.md
1685
docs/index.md
File diff suppressed because it is too large
Load Diff
@@ -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
Reference in New Issue
Block a user