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.
This commit is contained in:
arichornlover 2024-08-25 15:49:52 -05:00 committed by GitHub
parent d147b294ff
commit 483b294d4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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