From a9e0e97ed3a36c0106118cfadb8fc7430249ffe8 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Fri, 17 Jul 2026 19:30:35 +0200 Subject: [PATCH] fix(podcaster): stage YouTube imports on the SSD, not the eMMC root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit run_import computed its staging workdir as Path(media_dir).parent / youtube-import. media_dir is the symlink …/podcaster/media -> the SSD; taking .parent BEFORE resolving lands staging back on the eMMC root. A large playlist import then downloaded ~1.4G into eMMC staging, filled / to 99%, and stalled before moving anything to the SSD store — a recurring failure a symlink alone never fixed because the path is computed in code. .resolve() follows the symlink so staging and store share the SSD, and it derives from the real path so a package reinstall that re-lays the symlink cannot revert it. Verified: with media -> SSD, the workdir resolves onto the SSD. Co-Authored-By: Gerald KERMA --- packages/secubox-podcaster/api/importer.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/secubox-podcaster/api/importer.py b/packages/secubox-podcaster/api/importer.py index 85137230..c38c6205 100644 --- a/packages/secubox-podcaster/api/importer.py +++ b/packages/secubox-podcaster/api/importer.py @@ -223,7 +223,14 @@ def run_import(url: str, media_dir: str, mirror_peertube: bool, create_billets: JOB.update({"running": True, "url": url, "total": 0, "done": 0, "current": "", "errors": [], "feed_id": None, "started": int(time.time()), "finished": 0, "log": []}) - workdir = Path(media_dir).parent / "youtube-import" + # Stage on the SAME real filesystem as the media store. media_dir is usually + # a symlink onto the SSD (…/media -> /data/secubox/podcaster/media); taking + # .parent BEFORE resolving lands the staging back on the eMMC root — which is + # exactly how a large YouTube import filled the root fs to 99% and stalled + # (staging on eMMC, store on SSD). .resolve() follows the symlink so staging + # and store share the SSD. Durable: it derives from the real path, so a + # package reinstall that re-lays the symlink cannot revert it. + workdir = Path(media_dir).resolve().parent / "youtube-import" try: entries = _enumerate(url) if not entries: