From e9fc694970a1cb7b73062d85abfc348ce3945a42 Mon Sep 17 00:00:00 2001 From: Gramps Date: Sun, 27 Jul 2025 20:15:09 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=A0=20Metadata=20finalization:=20integ?= =?UTF-8?q?rated=20clip/session=20merge,=20persistent=20archive,=20and=20s?= =?UTF-8?q?equential=20title=20suffixing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- sync_wiki.py | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sync_wiki.py diff --git a/sync_wiki.py b/sync_wiki.py new file mode 100644 index 0000000..532d56f --- /dev/null +++ b/sync_wiki.py @@ -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()