Skip to content

Add object detection, tracking, mobile notifications, and search to any security camera.

fix get-classes a bit

roryclearb886729e9eed
diff --git a/clearcam/FileServer.m b/clearcam/FileServer.m
index 80bfc5b..9c0fb01 100644
--- a/clearcam/FileServer.m
+++ b/clearcam/FileServer.m
@@ -332,7 +332,7 @@
}
if ([filePath hasPrefix:@"get-classes"]) {
- NSString *currentClasses = self.currentClasses ?: @"custom"; // Default to "custom" if not set
+ NSString *currentClasses = self.currentClasses ?: @"all"; // Default to "all" if not set
[self sendJson200:@[currentClasses] toClient:clientSocket]; // Send as an array
return;
}
diff --git a/clearcam/player.html b/clearcam/player.html
index 77f7f68..57a41fe 100644
--- a/clearcam/player.html
+++ b/clearcam/player.html
@@ -421,8 +421,8 @@
fetch('get-classes')
.then(response => response.json())
.then(data => {
- if (data.currentClasses) {
- updateDropdown(data.currentClasses);
+ if (Array.isArray(data) && data.length > 0) {
+ updateDropdown(data[0]); // Extract the first element
}
})
.catch(error => {