Skip to content

Commit aec64ba

Browse files
committed
ruggedize path calculation
1 parent 4669b24 commit aec64ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/api/hooks/routes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ async def receive_hook(
4343
if hook_request.type == "post-finish":
4444
ingest = Ingester(archive_base_path=settings.archive_dir, django_api=django_api)
4545
upload_meta = get_upload_metadata(hook_request)
46-
upload_file = Path(hook_request.event.upload.storage["Path"]).relative_to(Path("/"))
46+
# eg. /upload/12345/original_video.mp4
47+
path_from_tus = Path(hook_request.event.upload.storage["Path"])
48+
# eg. ./upload/12345/original_video.mp4
49+
upload_file = settings.tusd_dir / path_from_tus.relative_to(Path("/upload"))
4750

4851
try:
4952
metadata = await metadata_extractor.assert_compliance(upload_file)

0 commit comments

Comments
 (0)