Skip to content

Commit

Permalink
improve photo backup and fix crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
lilthree committed Feb 5, 2024
1 parent 846300f commit e6f1a27
Show file tree
Hide file tree
Showing 15 changed files with 524 additions and 312 deletions.
12 changes: 6 additions & 6 deletions Pod/Classes/SeafConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "AFNetworking.h"
#import "SeafCacheProvider.h"
#import "SeafBase.h"
#import "SeafPhotoBackupTool.h"

#define HTTP_ERR_UNAUTHORIZED 401
#define HTTP_ERR_LOGIN_INCORRECT_PASSWORD 400
Expand Down Expand Up @@ -39,10 +40,6 @@ typedef void (^CompletionBlock)(BOOL success, NSError * _Nullable error);

BOOL SeafServerTrustIsValid(SecTrustRef _Nonnull serverTrust);

@protocol SeafPhotoSyncWatcherDelegate <NSObject>
- (void)photoSyncChanged:(long)remain;
@end

@protocol SeafLoginDelegate <NSObject>
- (void)loginSuccess:(SeafConnection *_Nonnull)connection;
- (void)loginFailed:(SeafConnection *_Nonnull)connection response:(NSHTTPURLResponse *_Nonnull)response error:(NSError *_Nullable)error;
Expand Down Expand Up @@ -85,7 +82,8 @@ BOOL SeafServerTrustIsValid(SecTrustRef _Nonnull serverTrust);
@property (readwrite, nonatomic, getter=isAutoSync) BOOL autoSync;
@property (readwrite, nonatomic, getter=isVideoSync) BOOL videoSync;
@property (readwrite, nonatomic, getter=isBackgroundSync) BOOL backgroundSync;
@property (assign, nonatomic) BOOL uploadHeicEnabled;
@property (readwrite, nonatomic, getter=isFirstTimeSync) BOOL firstTimeSync;
@property (assign, nonatomic, getter=isUploadHeicEnabled) BOOL uploadHeicEnabled;

@property (readwrite, nonatomic) NSString * _Nullable autoSyncRepo;

Expand All @@ -94,11 +92,12 @@ BOOL SeafServerTrustIsValid(SecTrustRef _Nonnull serverTrust);
@property (readwrite, nonatomic) BOOL touchIdEnabled;
@property (readonly) NSURLCredential *_Nullable clientCred;

@property (weak) id<SeafPhotoSyncWatcherDelegate> _Nullable photSyncWatcher;
@property (readonly) BOOL inAutoSync;

@property (readonly) NSString *_Nullable avatar;

@property (nonatomic, strong) SeafPhotoBackupTool * _Nullable photoBackup;


- (id _Nonnull)initWithUrl:(NSString *_Nonnull)url cacheProvider:(id<SeafCacheProvider> _Nullable )cacheProvider;
- (id _Nonnull)initWithUrl:(NSString * _Nonnull)url cacheProvider:(id<SeafCacheProvider> _Nullable )cacheProvider username:(NSString * _Nonnull)username ;
Expand Down Expand Up @@ -181,6 +180,7 @@ BOOL SeafServerTrustIsValid(SecTrustRef _Nonnull serverTrust);

- (void)checkAutoSync;
- (NSUInteger)photosInSyncing;
- (BOOL)isCheckingPhotoLibrary;
- (void)checkSyncDst:(SeafDir *_Nonnull)dir;
- (void)photosDidChange:(NSNotification *_Nullable)note;

Expand Down
Loading

0 comments on commit e6f1a27

Please sign in to comment.