This commit is contained in:
2025-06-29 12:41:12 +02:00
parent 6cc2342b20
commit 1aafe84e9d

View File

@@ -40,7 +40,7 @@ class mqtt_sender():
mqtt_s = mqtt_sender("mqtt.home.lan", 1883, "jaydee", "jaydee1")
mqtt_s.send_mqtt_message("sectorq/auto_import/import", {"status": "started"})
mqtt_s.send_mqtt_message("sectorq/auto_import/import", {"status": "started","file":""})
@@ -195,6 +195,7 @@ for d in import_drives:
logging.debug("Moving file {} into {}".format(filename, _FDEST))
try:
shutil.move("{}/{}".format(FULL_PATH,filename),_FDEST)
mqtt_s.send_mqtt_message("sectorq/auto_import/import", {"status": "started","file":filename})
except:
try:
shutil.move("{}/{}".format(FULL_PATH,filename),"{}/{}".format(_FDEST,filename))
@@ -209,8 +210,10 @@ for d in import_drives:
subprocess.getstatusoutput(myCmd)
else:
logging.debug(f"File: {file_or_dir}")
mqtt_s.send_mqtt_message("sectorq/auto_import/import", {"status": "started","file":file_or_dir})
try:
shutil.move("{}/{}".format(_DEV_DIR,file_or_dir),_FDEST)
except:
try:
shutil.move("{}/{}".format(_DEV_DIR,file_or_dir),"{}/{}".format(_FDEST,file_or_dir))