Skip to content

Commit

Permalink
Cloud sync fixes - ignore .DS_Store files and re-sync on app foregrou…
Browse files Browse the repository at this point in the history
  • Loading branch information
warmenhoven authored and Sunderland93 committed Dec 26, 2024
1 parent 3f5d57c commit 7396e7a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/task_cloudsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ static bool task_cloud_sync_should_ignore_file(const char *filename)
return true;
}

if (string_ends_with(filename, "/.DS_Store"))
return true;

return false;
}

Expand Down
1 change: 1 addition & 0 deletions ui/drivers/cocoa/apple_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ UINavigationControllerDelegate> {
@property (nonatomic) UIWindow* window;
@property (nonatomic) NSString* documentsDirectory;
@property (nonatomic) int menu_count;
@property (nonatomic) NSDate *bgDate;

+ (RetroArch_iOS*)get;

Expand Down
14 changes: 14 additions & 0 deletions ui/drivers/ui_cocoatouch.m
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,11 @@ - (void)applicationWillTerminate:(UIApplication *)application
retroarch_main_quit();
}

- (void)applicationWillResignActive:(UIApplication *)application
{
self.bgDate = [NSDate date];
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
rarch_start_draw_observer();
Expand All @@ -573,6 +578,15 @@ - (void)applicationDidBecomeActive:(UIApplication *)application

if (!ui_companion_start_on_boot)
[self showGameView];

if (self.bgDate)
{
if ( [[NSDate date] timeIntervalSinceDate:self.bgDate] > 60.0f
&& ( !(runloop_get_flags() & RUNLOOP_FLAG_CORE_RUNNING)
|| retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL)))
task_push_cloud_sync();
self.bgDate = nil;
}
}

-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
Expand Down

0 comments on commit 7396e7a

Please sign in to comment.