From 483b294d4f14195cc4aeeab218fc942c02c75abd Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Sun, 25 Aug 2024 15:49:52 -0500 Subject: [PATCH] Added date to Exported Settings file Experimental and Untested. This is something that would be useful to prevent overriding the previous .txt settings file whenever exporting settings again. --- Source/Settings.xm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Settings.xm b/Source/Settings.xm index 5bfd862..8455e2e 100644 --- a/Source/Settings.xm +++ b/Source/Settings.xm @@ -123,7 +123,9 @@ static const NSInteger YTLiteSection = 789; selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { if (IS_ENABLED(@"switchCopyandPasteFunctionality_enabled")) { // Export Settings functionality - NSURL *tempFileURL = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:@"exported_settings.txt"]]; + NSString *dateString = [self getCurrentDateAsString]; + NSString *fileName = [NSString stringWithFormat:@"YTLitePlusSettings_%@", dateString]; + NSURL *tempFileURL = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[fileName stringByAppendingString:@".txt"]]]; NSMutableString *settingsString = [NSMutableString string]; for (NSString *key in copyKeys) { id value = [[NSUserDefaults standardUserDefaults] objectForKey:key];