xm: ignore upload-queue-empty

the message is sent by up2k when all uploads done; #949
This commit is contained in:
ed 2025-11-29 07:54:52 +01:00
parent 867237d06a
commit 3f4b79ffb8
3 changed files with 10 additions and 1 deletions

View file

@ -34,7 +34,10 @@ MOUNT_BASE = b"/run/media/egon/"
def main():
try:
label = sys.argv[1].split(":usb-eject:")[1].split(":")[0]
msg = sys.argv[1]
if msg.startswith("upload-queue-empty;"):
return
label = msg.split(":usb-eject:")[1].split(":")[0]
mp = MOUNT_BASE + unquote(label)
# print("ejecting [%s]... " % (mp,), end="")
mp = os.path.abspath(os.path.realpath(mp))

View file

@ -62,6 +62,9 @@ def do_stuff(inf):
log = inf["log"]
url = inf["txt"]
if url.startswith("upload-queue-empty;"):
return
if "://" not in url:
url = "https://" + url

View file

@ -47,6 +47,9 @@ while you're in the /inc folder (or any folder below there)
def main():
inf = json.loads(sys.argv[1])
url = inf["txt"]
if url.startswith("upload-queue-empty;"):
return
if "://" not in url:
url = "https://" + url