File tree 3 files changed +11
-4
lines changed 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ let package = Package(
11
11
targets: [
12
12
. binaryTarget(
13
13
name: " WordPressKit " ,
14
- url: " https://github.com/user-attachments/files/19034191 /WordPressKit.zip " ,
15
- checksum: " 34f108cba86b5e4334d1c9af79946dbb8b665e270bdd14bc8f7bc0ba7a898583 "
14
+ url: " https://github.com/user-attachments/files/19315257 /WordPressKit.zip " ,
15
+ checksum: " 1b4ba5cef01a64e98ffdc02a5c8ac92f550f234222bfb6abf11b4b4df94435bc "
16
16
) ,
17
17
]
18
18
)
Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ import Foundation
58
58
/// Blog's total disk quota space used.
59
59
public var quotaSpaceUsed : NSNumber ?
60
60
61
+ public var isDeleted : Bool
62
+
61
63
/// Parses details from a JSON dictionary, as returned by the WordPress.com REST API.
62
64
@objc ( initWithJSONDictionary: )
63
65
public init ( jsonDictionary json: NSDictionary ) {
@@ -79,6 +81,7 @@ import Foundation
79
81
self . planActiveFeatures = ( json. array ( forKeyPath: " plan.features.active " ) as? [ String ] ) ?? [ ]
80
82
self . quotaSpaceAllowed = json. number ( forKeyPath: " quota.space_allowed " )
81
83
self . quotaSpaceUsed = json. number ( forKeyPath: " quota.space_used " )
84
+ self . isDeleted = json. number ( forKey: " is_deleted " ) ? . boolValue == true
82
85
}
83
86
84
87
}
Original file line number Diff line number Diff line change @@ -385,10 +385,14 @@ - (RemoteUser *)remoteUserFromDictionary:(NSDictionary *)dictionary
385
385
- (NSArray *)remoteBlogsFromJSONArray : (NSArray *)jsonBlogs
386
386
{
387
387
NSArray *blogs = jsonBlogs;
388
- return [blogs wpkit_map: ^id (NSDictionary *jsonBlog) {
388
+ return [[ blogs wpkit_map: ^id (NSDictionary *jsonBlog) {
389
389
return [[RemoteBlog alloc ] initWithJSONDictionary: jsonBlog];
390
+ }] wpkit_filter: ^BOOL (RemoteBlog *blog) {
391
+ // Exclude deleted sites from query result, since the app does not handle deleted sites properly.
392
+ // I tried to use query arguments `site_visibility=visible` and `site_activity=active`, but neither excludes
393
+ // deleted sites.
394
+ return !blog.isDeleted ;
390
395
}];
391
- return blogs;
392
396
}
393
397
394
398
@end
You can’t perform that action at this time.
0 commit comments