diff --git a/CHANGELOG.md b/CHANGELOG.md
index bbd3237..7539d09 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,11 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
---
+## [1.20.45] — 2026-08-19
+
+### Fixed
+- **Temporary upload sources are now removed after conversion.** Audio previews no longer leave the original uploaded file behind in the temporary directory alongside the registered WAV.
+
## [1.20.44] — 2026-08-19
### Fixed
diff --git a/VERSION b/VERSION
index 6a36890..b741e05 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.20.44
+1.20.45
diff --git a/routes/library.py b/routes/library.py
index 5da1d08..003d014 100644
--- a/routes/library.py
+++ b/routes/library.py
@@ -149,12 +149,22 @@ async def upload(file: UploadFile = File(...)):
if suffix not in _UPLOAD_EXTS:
raise HTTPException(400, "Unsupported audio/video file type")
dest = TEMP_DIR / f"{uuid.uuid4().hex}{suffix}"
- with dest.open("wb") as f:
- _copy_limited(file.file, f, _MAX_UPLOAD_BYTES)
try:
+ with dest.open("wb") as f:
+ _copy_limited(file.file, f, _MAX_UPLOAD_BYTES)
wav = _to_wav_24k(dest)
except Exception as e:
+ if isinstance(e, HTTPException):
+ raise
raise HTTPException(400, f"Audio conversion failed: {e}")
+ finally:
+ # The converted WAV is registered below; the original upload is only
+ # an intermediate and must not accumulate in TEMP_DIR after every
+ # preview/upload operation.
+ try:
+ dest.unlink(missing_ok=True)
+ except Exception:
+ pass
fid = uuid.uuid4().hex
_registry_put(fid, wav)
return {"id": fid, "duration": _duration(wav), "filename": file.filename}
diff --git a/static/index.html b/static/index.html
index d68fdac..35a07b2 100644
--- a/static/index.html
+++ b/static/index.html
@@ -10,7 +10,7 @@
-
+
@@ -27,7 +27,7 @@
-
+
@@ -378,7 +378,7 @@ window.toggleNavTree = function(treeId, chevronId) {
-
+