58 lines
3.0 KiB
Python
58 lines
3.0 KiB
Python
import os
|
|
import re
|
|
|
|
CONTENT_DIR = "content/podcast"
|
|
updates = [
|
|
{"old": "ep-001-systemprompt-und-prompting.yaml", "id": "ep-001-systemprompt-und-prompting", "title": "Systemprompt & Prompting", "date": "2025-11-19"},
|
|
{"old": "ep-002-llms-und-wahrheit.yaml", "id": "ep-002-llms-und-wahrheit", "title": "LLMs & Wahrheit", "date": "2025-12-03"},
|
|
{"old": "ep-003-kometen-und-ki-browser.yaml", "id": "ep-003-kometen-und-ki-browser", "title": "Kometen & KI-Browser", "date": "2025-12-17"},
|
|
{"old": "ep-004-deepfakes-und-ki-pornos.yaml", "id": "ep-004-deepfakes-und-ki-pornos", "title": "Deepfakes & KI-Pornos", "date": "2025-12-31"},
|
|
{"old": "ep-005-reasoning-und-recherchen.yaml", "id": "ep-005-reasoning-und-recherchen", "title": "Reasoning & komplexere Recherchen", "date": None},
|
|
{"old": "ep-006-kinder-und-ki.yaml", "id": "ep-006-kinder-und-ki", "title": "Kinder & KI", "date": None},
|
|
{"old": "ep-007-agenten-mcp-a2a.yaml", "id": "ep-007-agenten-mcp-a2a", "title": "Agenten (Teil 1) MCP & A2A", "date": None},
|
|
{"old": "ep-008-agenten-openclaw-moltbook.yaml", "id": "ep-008-agenten-openclaw-moltbook", "title": "Agenten (Teil 2) OpenClaw & Moltbook", "date": None},
|
|
{"old": "ep-009-rags-und-vektordatenbanken.yaml", "id": "ep-009-rags-und-vektordatenbanken", "title": "RAGs & Vektordatenbanken", "date": None},
|
|
# Skip ep-010-ki-und-kirche.yaml, delete it later
|
|
{"old": "ep-011-datensouveraenitaet-teil-1.yaml", "new": "ep-010-datensouveraenitaet-teil-1.yaml", "id": "ep-010-datensouveraenitaet-teil-1", "title": "Datensouveränität (Teil 1) & Abhängigkeiten", "date": None},
|
|
{"old": "ep-012-datensouveraenitaet-teil-2.yaml", "new": "ep-011-datensouveraenitaet-teil-2.yaml", "id": "ep-011-datensouveraenitaet-teil-2", "title": "Datensouveränität (Teil 2) & Föderierung", "date": None},
|
|
]
|
|
|
|
for up in updates:
|
|
old_path = os.path.join(CONTENT_DIR, up['old'])
|
|
if not os.path.exists(old_path):
|
|
print(f"Skipping {old_path}, not found.")
|
|
continue
|
|
|
|
with open(old_path, 'r', encoding='utf-8') as f:
|
|
content = f.read()
|
|
|
|
# Update id
|
|
content = re.sub(r'^id:\s*.*$', f'id: {up["id"]}', content, flags=re.MULTILINE)
|
|
|
|
# Update title
|
|
content = re.sub(r'^title:\s*.*$', f'title: "{up["title"]}"', content, flags=re.MULTILINE)
|
|
|
|
# Update date if specified
|
|
if up['date']:
|
|
content = re.sub(r'^date:\s*.*$', f'date: {up["date"]}', content, flags=re.MULTILINE)
|
|
|
|
new_filename = up.get('new', up['old'])
|
|
new_path = os.path.join(CONTENT_DIR, new_filename)
|
|
|
|
with open(new_path, 'w', encoding='utf-8') as f:
|
|
f.write(content)
|
|
|
|
print(f"Updated {new_path}")
|
|
|
|
# Remove old file if renamed
|
|
if new_filename != up['old']:
|
|
os.remove(old_path)
|
|
print(f"Removed {old_path}")
|
|
|
|
# Delete ki-und-kirche
|
|
kirche_path = os.path.join(CONTENT_DIR, 'ep-010-ki-und-kirche.yaml')
|
|
if os.path.exists(kirche_path):
|
|
os.remove(kirche_path)
|
|
print(f"Deleted {kirche_path}")
|
|
|