From a6a8c3b46f5d1f65b465aaa0d2b8359021e9be55 Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Tue, 10 May 2022 13:13:02 -0400 Subject: [PATCH] Update server.py Co-Authored-By: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> --- scripts/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/server.py b/scripts/server.py index 98ab410..32e8cfa 100755 --- a/scripts/server.py +++ b/scripts/server.py @@ -225,7 +225,7 @@ def analyzeAudioData(chunks, lat, lon, week, sensitivity, overlap,): return detections def sendAppriseNotifications(species,confidence): - if os.path.getsize(userDir + '/BirdNET-Pi/apprise.txt') > 0: + if os.path.exists(userDir + '/BirdNET-Pi/apprise.txt') and os.path.getsize(userDir + '/BirdNET-Pi/apprise.txt') > 0: with open(userDir + '/BirdNET-Pi/scripts/thisrun.txt', 'r') as f: this_run = f.readlines() title = str(str(str([i for i in this_run if i.startswith('APPRISE_NOTIFICATION_TITLE')]).split('=')[1]).split('\\')[0]).replace('"', '')