Cloud sync fixes - ignore .DS_Store files and re-sync on app foreground (#16055)

This commit is contained in:
Eric Warmenhoven 2023-12-28 14:10:13 -05:00 committed by GitHub
parent 3ce56c5b42
commit 99309a4d79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -559,6 +559,11 @@ enum
retroarch_main_quit();
}
- (void)applicationWillResignActive:(UIApplication *)application
{
self.bgDate = [NSDate date];
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
rarch_start_draw_observer();
@ -573,6 +578,15 @@ enum
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 {