Adjustments (uYouPlusSettings.xm)

This commit is contained in:
aricloverGitHub (INACTIVE) 2024-12-04 20:32:13 -06:00 committed by GitHub
parent 9623a2eb0b
commit 4f4bc5e07a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -332,17 +332,17 @@ extern NSBundle *uYouPlusBundle();
YTSettingsSectionItem *clearCache = [%c(YTSettingsSectionItem) YTSettingsSectionItem *clearCache = [%c(YTSettingsSectionItem)
itemWithTitle:@"Clear Cache" itemWithTitle:@"Clear Cache"
titleDescription:nil titleDescription:^NSString *() {
accessibilityIdentifier:nil return [NSString stringWithFormat:LOC(@"Current Cache Size: %@"), GetCacheSize()];
detailTextBlock:^NSString *() {
return GetCacheSize();
} }
accessibilityIdentifier:nil
detailTextBlock:nil
selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSString *cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject; NSString *cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
[[NSFileManager defaultManager] removeItemAtPath:cachePath error:nil]; [[NSFileManager defaultManager] removeItemAtPath:cachePath error:nil];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[cell setDetailText:GetCacheSize()]; [settingsViewController.tableView reloadData];
[[%c(YTToastResponderEvent) eventWithMessage:LOC(@"Done") firstResponder:[self parentResponder]] send]; [[%c(YTToastResponderEvent) eventWithMessage:LOC(@"Done") firstResponder:[self parentResponder]] send];
}); });
}); });