mirror of
https://github.com/9001/copyparty.git
synced 2026-03-23 00:23:47 +10:00
send msg when uploads finished; closes #949
This commit is contained in:
12
bin/u2c.py
12
bin/u2c.py
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user