🧠 Metadata finalization: integrated clip/session merge, persistent archive, and sequential title suffixing
- Merged clip-level and session-level metadata into a unified object - Stored notes.json inline and as a child field for structured access - Implemented local NoSQL-style history archive for uploaded videos - Added YouTube/PeerTube URL arrays to metadata post-upload - Ensured sequential titling for multiple sessions on the same day - Removed source folder after upload when DEBUG == False
This commit is contained in:
53
sync_wiki.py
Normal file
53
sync_wiki.py
Normal file
@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
sync_wiki.py
|
||||
|
||||
Synchronizes local markdown files in docs/wiki/ to the GitHub wiki
|
||||
for the Llama Chile Shop video pipeline project.
|
||||
|
||||
Requires the GitHub wiki repo to be cloned into ./video-pipeline.wiki/.
|
||||
|
||||
Author: gramps@llamachile.shop
|
||||
"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
# Paths
|
||||
LOCAL_WIKI_SOURCE = Path("docs/wiki") # Where local .md pages are stored
|
||||
LOCAL_WIKI_REPO = Path("video-pipeline.wiki") # Where the GitHub wiki repo is cloned
|
||||
|
||||
def sync_wiki():
|
||||
"""
|
||||
Copies markdown files from the local wiki source into the cloned wiki repo
|
||||
and pushes the changes to GitHub.
|
||||
"""
|
||||
if not LOCAL_WIKI_REPO.exists():
|
||||
print("❌ Wiki repo not found. Clone it using:")
|
||||
print(" git clone https://github.com/LCS-Gramps/video-pipeline.wiki.git")
|
||||
return
|
||||
|
||||
print("📄 Syncing wiki markdown files...")
|
||||
for md_file in LOCAL_WIKI_SOURCE.glob("*.md"):
|
||||
target = LOCAL_WIKI_REPO / md_file.name
|
||||
shutil.copy2(md_file, target)
|
||||
print(f"✅ Synced: {md_file.name}")
|
||||
|
||||
# Change directory to the cloned wiki repo for Git operations
|
||||
os.chdir(LOCAL_WIKI_REPO)
|
||||
|
||||
try:
|
||||
print("📚 Committing changes...")
|
||||
subprocess.run(["git", "add", "."], check=True)
|
||||
subprocess.run(["git", "commit", "-m", "📚 Sync updated wiki pages from docs/wiki"], check=True)
|
||||
subprocess.run(["git", "push"], check=True)
|
||||
print("🚀 Wiki updated successfully.")
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"❌ Git command failed: {e}")
|
||||
print("💡 Tip: You may need to mark the repo as safe:")
|
||||
print(" git config --global --add safe.directory '//chong/LCS/Videos/eklipse/video-pipeline.wiki'")
|
||||
|
||||
if __name__ == "__main__":
|
||||
sync_wiki()
|
||||
Reference in New Issue
Block a user