Skip to content

Commit

Permalink
TRANSFER_FINISHED event after upload file via PUT
Browse files Browse the repository at this point in the history
  • Loading branch information
ondratu committed Oct 14, 2024
1 parent d4db7cb commit 01f6885
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions prusa/link/web/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from poorwsgi.response import JSONResponse, Response

from prusa.connect.printer.const import (
Event,
FileType,
Source,
StorageType,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 01f6885

Please sign in to comment.