{"action":"created","comment":{"url":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/comments/238115679","pull_request_review_id":180578555,"id":238115679,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODExNTY3OQ==","diff_hunk":"@@ -1229,11 +1175,71 @@ - (void)editOperation:(id)sender\n             [SVProgressHUD showWithStatus:NSLocalizedString(@\"Deleting files ...\", @\"Seafile\")];\n             break;\n         }\n+        case EDITOP_EXPORT: {\n+            [self exportSelected];\n+        }\n         default:\n             break;\n     }\n }\n \n+- (void)exportSelected {\n+    NSArray *idxs = [self.tableView indexPathsForSelectedRows];\n+    if (!idxs) return;\n+    NSMutableArray *entries = [[NSMutableArray alloc] init];\n+    for (NSIndexPath *indexPath in idxs) {\n+        id entry = [self getDentrybyIndexPath:indexPath tableView:self.tableView];\n+        [entries addObject:entry];\n+    }\n+    self.state = STATE_EXPORT;\n+    [self editDone:nil];\n+    [self downloadEntries:entries completion:^(BOOL result, NSArray *array) {\n+         self.state = STATE_INIT;\n+        if (result) {\n+            [SeafActionsManager exportByActivityView:array item:self.toolbarItems.firstObject targerVC:self];\n+        }\n+    }];\n+}\n+\n+- (void)downloadEntries:(NSArray *)entries completion:(DownloadCompleteBlock)block {\n+    NSMutableArray *urls = [NSMutableArray array];\n+    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);\n+    dispatch_group_t group = dispatch_group_create();\n+    [SVProgressHUD show];\n+    for (id entry in entries) {\n+        dispatch_group_enter(group);\n+        dispatch_barrier_async(queue, ^{\n+            SeafFile *file = (SeafFile *)entry;\n+            [file loadCache];\n+            NSURL *exportURL = file.exportURL;\n+            if (!exportURL) {\n+                [SeafDataTaskManager.sharedObject addFileDownloadTask:file];\n+                Debug(\"Download file %@\", file.path);\n+                [file setFileDownloadedBlock:^(SeafFile * _Nonnull file, NSError * _Nullable error) {\n+                    if (error) {\n+                        Warning(\"Failed to donwload file %@: %@\", file.path, error);\n+                        [NSString stringWithFormat:NSLocalizedString(@\"Failed to download file '%@'\", @\"Seafile\"), file.previewItemTitle];","path":"seafile/SeafFileViewController.m","position":342,"original_position":342,"commit_id":"12e187cf0cc356a602e03e806e72829c2569e57c","original_commit_id":"12e187cf0cc356a602e03e806e72829c2569e57c","user":{"login":"poetwang","id":1908737,"node_id":"MDQ6VXNlcjE5MDg3Mzc=","avatar_url":"https://avatars0.githubusercontent.com/u/1908737?v=4","gravatar_id":"","url":"https://api.github.com/users/poetwang","html_url":"https://github.com/poetwang","followers_url":"https://api.github.com/users/poetwang/followers","following_url":"https://api.github.com/users/poetwang/following{/other_user}","gists_url":"https://api.github.com/users/poetwang/gists{/gist_id}","starred_url":"https://api.github.com/users/poetwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poetwang/subscriptions","organizations_url":"https://api.github.com/users/poetwang/orgs","repos_url":"https://api.github.com/users/poetwang/repos","events_url":"https://api.github.com/users/poetwang/events{/privacy}","received_events_url":"https://api.github.com/users/poetwang/received_events","type":"User","site_admin":false},"body":"this string is never used.","created_at":"2018-12-02T21:35:59Z","updated_at":"2018-12-02T21:36:39Z","html_url":"https://github.com/haiwen/seafile-iOS/pull/235#discussion_r238115679","pull_request_url":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/235","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/comments/238115679"},"html":{"href":"https://github.com/haiwen/seafile-iOS/pull/235#discussion_r238115679"},"pull_request":{"href":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/235","id":235053468,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1MDUzNDY4","html_url":"https://github.com/haiwen/seafile-iOS/pull/235","diff_url":"https://github.com/haiwen/seafile-iOS/pull/235.diff","patch_url":"https://github.com/haiwen/seafile-iOS/pull/235.patch","issue_url":"https://api.github.com/repos/haiwen/seafile-iOS/issues/235","number":235,"state":"open","locked":false,"title":"Ui change","user":{"login":"lilthree","id":16398987,"node_id":"MDQ6VXNlcjE2Mzk4OTg3","avatar_url":"https://avatars3.githubusercontent.com/u/16398987?v=4","gravatar_id":"","url":"https://api.github.com/users/lilthree","html_url":"https://github.com/lilthree","followers_url":"https://api.github.com/users/lilthree/followers","following_url":"https://api.github.com/users/lilthree/following{/other_user}","gists_url":"https://api.github.com/users/lilthree/gists{/gist_id}","starred_url":"https://api.github.com/users/lilthree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lilthree/subscriptions","organizations_url":"https://api.github.com/users/lilthree/orgs","repos_url":"https://api.github.com/users/lilthree/repos","events_url":"https://api.github.com/users/lilthree/events{/privacy}","received_events_url":"https://api.github.com/users/lilthree/received_events","type":"User","site_admin":false},"body":"UI adapt iPhoneX and new iPhone. Share multiple pictures and files  #224 ","created_at":"2018-11-30T16:59:36Z","updated_at":"2018-12-02T21:36:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31f0e5db0145a9776bab98059e4ce5da9fd84ae8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/235/commits","review_comments_url":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/235/comments","review_comment_url":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/haiwen/seafile-iOS/issues/235/comments","statuses_url":"https://api.github.com/repos/haiwen/seafile-iOS/statuses/12e187cf0cc356a602e03e806e72829c2569e57c","head":{"label":"haiwen:ui_change","ref":"ui_change","sha":"12e187cf0cc356a602e03e806e72829c2569e57c","user":{"login":"haiwen","id":1948782,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDg3ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/1948782?v=4","gravatar_id":"","url":"https://api.github.com/users/haiwen","html_url":"https://github.com/haiwen","followers_url":"https://api.github.com/users/haiwen/followers","following_url":"https://api.github.com/users/haiwen/following{/other_user}","gists_url":"https://api.github.com/users/haiwen/gists{/gist_id}","starred_url":"https://api.github.com/users/haiwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haiwen/subscriptions","organizations_url":"https://api.github.com/users/haiwen/orgs","repos_url":"https://api.github.com/users/haiwen/repos","events_url":"https://api.github.com/users/haiwen/events{/privacy}","received_events_url":"https://api.github.com/users/haiwen/received_events","type":"Organization","site_admin":false},"repo":{"id":7285398,"node_id":"MDEwOlJlcG9zaXRvcnk3Mjg1Mzk4","name":"seafile-iOS","full_name":"haiwen/seafile-iOS","private":false,"owner":{"login":"haiwen","id":1948782,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDg3ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/1948782?v=4","gravatar_id":"","url":"https://api.github.com/users/haiwen","html_url":"https://github.com/haiwen","followers_url":"https://api.github.com/users/haiwen/followers","following_url":"https://api.github.com/users/haiwen/following{/other_user}","gists_url":"https://api.github.com/users/haiwen/gists{/gist_id}","starred_url":"https://api.github.com/users/haiwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haiwen/subscriptions","organizations_url":"https://api.github.com/users/haiwen/orgs","repos_url":"https://api.github.com/users/haiwen/repos","events_url":"https://api.github.com/users/haiwen/events{/privacy}","received_events_url":"https://api.github.com/users/haiwen/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/haiwen/seafile-iOS","description":"iOS client for seafile","fork":false,"url":"https://api.github.com/repos/haiwen/seafile-iOS","forks_url":"https://api.github.com/repos/haiwen/seafile-iOS/forks","keys_url":"https://api.github.com/repos/haiwen/seafile-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haiwen/seafile-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haiwen/seafile-iOS/teams","hooks_url":"https://api.github.com/repos/haiwen/seafile-iOS/hooks","issue_events_url":"https://api.github.com/repos/haiwen/seafile-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/haiwen/seafile-iOS/events","assignees_url":"https://api.github.com/repos/haiwen/seafile-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/haiwen/seafile-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/haiwen/seafile-iOS/tags","blobs_url":"https://api.github.com/repos/haiwen/seafile-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haiwen/seafile-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haiwen/seafile-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/haiwen/seafile-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haiwen/seafile-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/haiwen/seafile-iOS/languages","stargazers_url":"https://api.github.com/repos/haiwen/seafile-iOS/stargazers","contributors_url":"https://api.github.com/repos/haiwen/seafile-iOS/contributors","subscribers_url":"https://api.github.com/repos/haiwen/seafile-iOS/subscribers","subscription_url":"https://api.github.com/repos/haiwen/seafile-iOS/subscription","commits_url":"https://api.github.com/repos/haiwen/seafile-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/haiwen/seafile-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/haiwen/seafile-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/haiwen/seafile-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/haiwen/seafile-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/haiwen/seafile-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haiwen/seafile-iOS/merges","archive_url":"https://api.github.com/repos/haiwen/seafile-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haiwen/seafile-iOS/downloads","issues_url":"https://api.github.com/repos/haiwen/seafile-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/haiwen/seafile-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/haiwen/seafile-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/haiwen/seafile-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haiwen/seafile-iOS/labels{/name}","releases_url":"https://api.github.com/repos/haiwen/seafile-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/haiwen/seafile-iOS/deployments","created_at":"2012-12-22T11:50:15Z","updated_at":"2018-12-01T20:14:10Z","pushed_at":"2018-12-02T17:02:28Z","git_url":"git://github.com/haiwen/seafile-iOS.git","ssh_url":"git@github.com:haiwen/seafile-iOS.git","clone_url":"https://github.com/haiwen/seafile-iOS.git","svn_url":"https://github.com/haiwen/seafile-iOS","homepage":null,"size":16724,"stargazers_count":152,"watchers_count":152,"language":"Objective-C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":111,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":111,"open_issues":19,"watchers":152,"default_branch":"master"}},"base":{"label":"haiwen:master","ref":"master","sha":"40a5733999d3ce1bee1782061eed33953bb363cb","user":{"login":"haiwen","id":1948782,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDg3ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/1948782?v=4","gravatar_id":"","url":"https://api.github.com/users/haiwen","html_url":"https://github.com/haiwen","followers_url":"https://api.github.com/users/haiwen/followers","following_url":"https://api.github.com/users/haiwen/following{/other_user}","gists_url":"https://api.github.com/users/haiwen/gists{/gist_id}","starred_url":"https://api.github.com/users/haiwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haiwen/subscriptions","organizations_url":"https://api.github.com/users/haiwen/orgs","repos_url":"https://api.github.com/users/haiwen/repos","events_url":"https://api.github.com/users/haiwen/events{/privacy}","received_events_url":"https://api.github.com/users/haiwen/received_events","type":"Organization","site_admin":false},"repo":{"id":7285398,"node_id":"MDEwOlJlcG9zaXRvcnk3Mjg1Mzk4","name":"seafile-iOS","full_name":"haiwen/seafile-iOS","private":false,"owner":{"login":"haiwen","id":1948782,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDg3ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/1948782?v=4","gravatar_id":"","url":"https://api.github.com/users/haiwen","html_url":"https://github.com/haiwen","followers_url":"https://api.github.com/users/haiwen/followers","following_url":"https://api.github.com/users/haiwen/following{/other_user}","gists_url":"https://api.github.com/users/haiwen/gists{/gist_id}","starred_url":"https://api.github.com/users/haiwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haiwen/subscriptions","organizations_url":"https://api.github.com/users/haiwen/orgs","repos_url":"https://api.github.com/users/haiwen/repos","events_url":"https://api.github.com/users/haiwen/events{/privacy}","received_events_url":"https://api.github.com/users/haiwen/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/haiwen/seafile-iOS","description":"iOS client for seafile","fork":false,"url":"https://api.github.com/repos/haiwen/seafile-iOS","forks_url":"https://api.github.com/repos/haiwen/seafile-iOS/forks","keys_url":"https://api.github.com/repos/haiwen/seafile-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haiwen/seafile-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haiwen/seafile-iOS/teams","hooks_url":"https://api.github.com/repos/haiwen/seafile-iOS/hooks","issue_events_url":"https://api.github.com/repos/haiwen/seafile-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/haiwen/seafile-iOS/events","assignees_url":"https://api.github.com/repos/haiwen/seafile-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/haiwen/seafile-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/haiwen/seafile-iOS/tags","blobs_url":"https://api.github.com/repos/haiwen/seafile-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haiwen/seafile-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haiwen/seafile-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/haiwen/seafile-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haiwen/seafile-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/haiwen/seafile-iOS/languages","stargazers_url":"https://api.github.com/repos/haiwen/seafile-iOS/stargazers","contributors_url":"https://api.github.com/repos/haiwen/seafile-iOS/contributors","subscribers_url":"https://api.github.com/repos/haiwen/seafile-iOS/subscribers","subscription_url":"https://api.github.com/repos/haiwen/seafile-iOS/subscription","commits_url":"https://api.github.com/repos/haiwen/seafile-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/haiwen/seafile-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/haiwen/seafile-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/haiwen/seafile-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/haiwen/seafile-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/haiwen/seafile-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haiwen/seafile-iOS/merges","archive_url":"https://api.github.com/repos/haiwen/seafile-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haiwen/seafile-iOS/downloads","issues_url":"https://api.github.com/repos/haiwen/seafile-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/haiwen/seafile-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/haiwen/seafile-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/haiwen/seafile-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haiwen/seafile-iOS/labels{/name}","releases_url":"https://api.github.com/repos/haiwen/seafile-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/haiwen/seafile-iOS/deployments","created_at":"2012-12-22T11:50:15Z","updated_at":"2018-12-01T20:14:10Z","pushed_at":"2018-12-02T17:02:28Z","git_url":"git://github.com/haiwen/seafile-iOS.git","ssh_url":"git@github.com:haiwen/seafile-iOS.git","clone_url":"https://github.com/haiwen/seafile-iOS.git","svn_url":"https://github.com/haiwen/seafile-iOS","homepage":null,"size":16724,"stargazers_count":152,"watchers_count":152,"language":"Objective-C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":111,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":111,"open_issues":19,"watchers":152,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/235"},"html":{"href":"https://github.com/haiwen/seafile-iOS/pull/235"},"issue":{"href":"https://api.github.com/repos/haiwen/seafile-iOS/issues/235"},"comments":{"href":"https://api.github.com/repos/haiwen/seafile-iOS/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/haiwen/seafile-iOS/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/haiwen/seafile-iOS/statuses/12e187cf0cc356a602e03e806e72829c2569e57c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"poetwang"}}