send msg when uploads finished; closes #949

This commit is contained in:
ed
2025-10-25 14:00:29 +00:00
parent b1efc0065c
commit db87ea5ce1
2 changed files with 22 additions and 4 deletions

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env python3
from __future__ import print_function, unicode_literals
S_VERSION = "2.14"
S_BUILD_DT = "2025-10-24"
S_VERSION = "2.15"
S_BUILD_DT = "2025-10-25"
"""
u2c.py: upload to copyparty
@@ -232,6 +232,7 @@ class HCli(object):
MJ = "application/json"
MO = "application/octet-stream"
MM = "application/x-www-form-urlencoded"
CLEN = "Content-Length"
web = None # type: HCli
@@ -979,6 +980,7 @@ class Ctl(object):
self.nfiles, self.nbytes = self.stats
self.filegen = walkdirs([], ar.files, ar.x)
self.recheck = [] # type: list[File]
self.last_file = None
if ar.safe:
self._safe()
@@ -1015,6 +1017,11 @@ class Ctl(object):
self._fancy()
file = self.last_file
if self.up_br and file:
zs = quotep(file.name.encode("utf-8", WTF8))
web.req("POST", file.url, {}, b"msg=upload-queue-empty;" + zs, MM)
self.ok = not self.errs
def _safe(self):
@@ -1453,6 +1460,7 @@ class Ctl(object):
file = fsl.file
cids = fsl.cids
self.last_file = file
with self.mutex:
if not self.uploader_busy: