优化下载皮肤❤️

This commit is contained in:
2025-12-23 15:26:32 +08:00
parent fbf9fe9f2a
commit 000d603241
5 changed files with 111 additions and 20 deletions

View File

@@ -42,6 +42,13 @@
if (completion) completion(NO);
return;
}
BOOL forceDownload = NO;
id forceValue = skinJSON[@"force_download"];
if ([forceValue respondsToSelector:@selector(boolValue)]) {
forceDownload = [forceValue boolValue];
}
NSLog(@"🧩[SkinService] apply mode=%lu id=%@ force=%d",
(unsigned long)mode, skinJSON[@"id"], forceDownload);
// // 1. & 访
// KBKeyboardPermissionManager *perm = [KBKeyboardPermissionManager shared];

View File

@@ -242,6 +242,7 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
[KBHUD showInfo:KBLocalized(@"正在加载主题详情")];
return;
}
NSLog(@"🧩[SkinDetail] action themeId=%@ purchased=%d", self.themeId, self.detailModel.isPurchased);
if (self.detailModel.isPurchased) {
[self requestDownload];
} else {
@@ -287,11 +288,17 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
if (self.detailModel.themePreviewImageUrl.length > 0) {
skin[@"preview"] = self.detailModel.themePreviewImageUrl;
}
skin[@"force_download"] = @(YES);
NSLog(@"⬇️[SkinDetail] download request id=%@ zip=%@ force=YES",
skin[@"id"], skin[@"zip_url"]);
[KBHUD showWithStatus:@"正在下载..."];
[[KBSkinService shared] applySkinWithJSON:skin
fromViewController:self
mode:KBSkinSourceModeRemoteZip
completion:^(BOOL success) {
completion:^(BOOL success) {
NSLog(@"%@[SkinDetail] download result id=%@",
(success ? @"✅" : @"❌"),
self.detailModel.themeId);
if (success) {
NSString *themeId = self.detailModel.themeId;
if (themeId.length > 0) {