Add object detection, tracking, mobile notifications, and search to any security camera.
remove useless filepath
roryclear9fa3f6eb6095
diff --git a/clearcam/FileServer.m b/clearcam/FileServer.mindex 449bd96..37df682 100644--- a/clearcam/FileServer.m+++ b/clearcam/FileServer.m@@ -664,11 +664,9 @@NSTimeInterval timeStamp = [timeStampNumber doubleValue];long long roundedTimestamp = (long long)floor(timeStamp); // Floor to integerNSString *imageFileName = [NSString stringWithFormat:@"%lld", roundedTimestamp];- NSString *imageFilePath = [imagesDirectory stringByAppendingPathComponent:[imageFileName stringByAppendingString:@".jpg"]];NSString *smallImageFilePath = [imagesDirectory stringByAppendingPathComponent:[imageFileName stringByAppendingString:@"_small.jpg"]];NSError *fileError = nil;- if ([fileManager fileExistsAtPath:imageFilePath]) [fileManager removeItemAtPath:imageFilePath error:&fileError];if ([fileManager fileExistsAtPath:smallImageFilePath]) [fileManager removeItemAtPath:smallImageFilePath error:&fileError];[self.context deleteObject:event];}diff --git a/clearcam/SceneState.h b/clearcam/SceneState.hindex 6b09f21..ba5e6fa 100644--- a/clearcam/SceneState.h+++ b/clearcam/SceneState.h@@ -11,6 +11,6 @@@property (strong, nonatomic) NSManagedObjectContext *backgroundContext;@property (strong, nonatomic) NSDate *last_notif_time;- (void)processOutput:(NSArray *)array withImage:(CIImage *)image;-- (void)sendnotification:(NSString *)filePath; //todo, remove+- (void)sendnotification; //todo, remove@enddiff --git a/clearcam/SceneState.m b/clearcam/SceneState.mindex 35e3dc8..99c9005 100644--- a/clearcam/SceneState.m+++ b/clearcam/SceneState.m@@ -86,12 +86,10 @@error:nil];}- // File path for the image- NSString *filePath = [imagesDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%lld.jpg", roundedUnixTimestamp]];NSData *imageData = UIImageJPEGRepresentation(uiImage, 1.0); // 1.0 for maximum qualityNSString *filePathSmall = [imagesDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%lld_small.jpg", roundedUnixTimestamp]];// Write the image data to file- if ([imageData writeToFile:filePath atomically:YES]) {+ if ([imageData writeToFile:filePathSmall atomically:YES]) {//thumbnailUIGraphicsBeginImageContextWithOptions(CGSizeMake(uiImage.size.width / 2, uiImage.size.height / 2), YES, 1.0);[uiImage drawInRect:CGRectMake(0, 0, uiImage.size.width / 2, uiImage.size.height / 2)];@@ -103,10 +101,10 @@if(![[NSUserDefaults standardUserDefaults] boolForKey:@"isSubscribed"] || ![[NSDate date] compare:[[NSUserDefaults standardUserDefaults] objectForKey:@"expiry"]] || [[NSDate date] compare:[[NSUserDefaults standardUserDefaults] objectForKey:@"expiry"]] == NSOrderedDescending){NSLog(@"verifying subscription");[[StoreManager sharedInstance] verifySubscriptionWithCompletion:^(BOOL isActive, NSDate *expiryDate) {- [self sendnotification:filePath];+ [self sendnotification];}];} else {- [self sendnotification:filePath];+ [self sendnotification];}}}@@ -131,7 +129,7 @@}}-- (void)sendnotification:(NSString *)filePath {+- (void)sendnotification {if ([[NSUserDefaults standardUserDefaults] boolForKey:@"send_notif_enabled"] || !([[NSUserDefaults standardUserDefaults] boolForKey:@"isSubscribed"] || [[NSUserDefaults standardUserDefaults] boolForKey:@"use_own_server_enabled"])){ //todo add back other stuffNSDate *now = [NSDate date];NSDateComponents *components = [[NSCalendar currentCalendar] components:(NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitWeekday) fromDate:now];