From 04200b948ba355849707be3ea3e0c38ee1012a6f Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Fri, 17 Jun 2022 11:16:59 -0400 Subject: [PATCH] Update server.py #388 --- scripts/server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/server.py b/scripts/server.py index c9c6ac1..5472e7f 100755 --- a/scripts/server.py +++ b/scripts/server.py @@ -242,7 +242,7 @@ def sendAppriseNotifications(species, confidence, path): except Exception as e: websiteurl = "http://"+socket.gethostname()+".local" - listenurl = websiteurl+"?filename="+species.split("_")[1].replace(" ","_")+"-"+str(round(float(confidence)*100))+"-"+path.split("/")[len(path.split("/"))-1].split(".")[0]+".mp3" + listenurl = websiteurl+"?filename="+path if str(str(str([i for i in this_run if i.startswith('APPRISE_NOTIFY_EACH_DETECTION')]).split('=')[1]).split('\\')[0]) == "1": @@ -290,7 +290,6 @@ def writeResultsToFile(detections, min_conf, path): for d in detections: for entry in detections[d]: if entry[1] >= min_conf and ((entry[0] in INCLUDE_LIST or len(INCLUDE_LIST) == 0) and (entry[0] not in EXCLUDE_LIST or len(EXCLUDE_LIST) == 0)): - sendAppriseNotifications(str(entry[0]), str(entry[1]), path) rfile.write(d + ';' + entry[0].replace('_', ';') + ';' + str(entry[1]) + '\n') rcnt += 1 print('DONE! WROTE', rcnt, 'RESULTS.') @@ -446,6 +445,8 @@ def handle_client(conn, addr): except BaseException: print("Database busy") time.sleep(2) + + sendAppriseNotifications(str(entry[0]), str(entry[1]), File_Name) print(str(current_date) + ';' +