From 01f688566f89263b95eea3f7a9b41a459b0f8913 Mon Sep 17 00:00:00 2001 From: Ondrej Tuma Date: Mon, 14 Oct 2024 10:57:02 +0200 Subject: [PATCH] TRANSFER_FINISHED event after upload file via PUT --- prusa/link/web/files.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/prusa/link/web/files.py b/prusa/link/web/files.py index 1f4e4ac4..1be7aa79 100644 --- a/prusa/link/web/files.py +++ b/prusa/link/web/files.py @@ -11,6 +11,7 @@ from poorwsgi.response import JSONResponse, Response from prusa.connect.printer.const import ( + Event, FileType, Source, StorageType, @@ -256,6 +257,12 @@ def file_upload(req, storage, path): temp.flush() fsync(temp.fileno()) + event_cb = app.daemon.prusa_link.printer.event_cb + event_cb(Event.TRANSFER_FINISHED, + Source.WUI, + destination=transfer.path, + transfer_id=transfer.transfer_id) + transfer.type = TransferType.NO_TRANSFER if req.content_length > uploaded: