{"action":"created","comment":{"url":"https://api.github.com/repos/Tribler/tribler/pulls/comments/241394337","pull_request_review_id":184653935,"id":241394337,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTM5NDMzNw==","diff_hunk":"@@ -156,6 +210,53 @@ def render_PUT(self, request):\n \n         parameters = http.parse_qs(request.content.read(), 1)\n \n+        torrents_dir = None\n+        if 'torrents_dir' in parameters and parameters['torrents_dir'] > 0:\n+            torrents_dir = parameters['torrents_dir'][0]\n+            if not os.path.isabs(torrents_dir):\n+                request.setResponseCode(http.BAD_REQUEST)\n+\n+        recursive = False\n+        if 'recursive' in parameters and parameters['recursive'] > 0:\n+            recursive = parameters['recursive'][0]\n+            if not torrents_dir:\n+                request.setResponseCode(http.BAD_REQUEST)\n+\n+        if torrents_dir:\n+            torrents_list = []\n+            errors_list = []\n+            filename_generator = None\n+\n+            if recursive:\n+                def rec_gen():\n+                    for root, dirnames, filenames in os.walk(torrents_dir):\n+                        for f in filenames:\n+                            yield os.path.join(root, f)\n+\n+                filename_generator = rec_gen()\n+            else:\n+                filename_generator = os.listdir(torrents_dir)\n+\n+            # Build list of .torrents to process\n+            for f in filename_generator:\n+                filepath = os.path.join(torrents_dir, f)\n+                # TODO: add support for arbitrary encodings\n+                filename = str(filepath) if sys.platform == 'win32' else filepath.decode('utf-8')","path":"Tribler/Core/Modules/restapi/channels/channels_torrents_endpoint.py","position":203,"original_position":201,"commit_id":"75b3f8d9de6abf67299385bf8d0e4f33048e7c79","original_commit_id":"1394509fd453e5600ac03436dd7fc42641c6db80","user":{"login":"ichorid","id":2509103,"node_id":"MDQ6VXNlcjI1MDkxMDM=","avatar_url":"https://avatars1.githubusercontent.com/u/2509103?v=4","gravatar_id":"","url":"https://api.github.com/users/ichorid","html_url":"https://github.com/ichorid","followers_url":"https://api.github.com/users/ichorid/followers","following_url":"https://api.github.com/users/ichorid/following{/other_user}","gists_url":"https://api.github.com/users/ichorid/gists{/gist_id}","starred_url":"https://api.github.com/users/ichorid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ichorid/subscriptions","organizations_url":"https://api.github.com/users/ichorid/orgs","repos_url":"https://api.github.com/users/ichorid/repos","events_url":"https://api.github.com/users/ichorid/events{/privacy}","received_events_url":"https://api.github.com/users/ichorid/received_events","type":"User","site_admin":false},"body":"the problem is, in Python, filesystem encoding could be different from the default system encoding...\r\nI'll change it, though, to `getdefaultencoding` as you suggested. It is better than what it is now.","created_at":"2018-12-13T13:15:38Z","updated_at":"2018-12-13T13:15:38Z","html_url":"https://github.com/Tribler/tribler/pull/4090#discussion_r241394337","pull_request_url":"https://api.github.com/repos/Tribler/tribler/pulls/4090","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Tribler/tribler/pulls/comments/241394337"},"html":{"href":"https://github.com/Tribler/tribler/pull/4090#discussion_r241394337"},"pull_request":{"href":"https://api.github.com/repos/Tribler/tribler/pulls/4090"}},"in_reply_to_id":241320273},"pull_request":{"url":"https://api.github.com/repos/Tribler/tribler/pulls/4090","id":236628235,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2NjI4MjM1","html_url":"https://github.com/Tribler/tribler/pull/4090","diff_url":"https://github.com/Tribler/tribler/pull/4090.diff","patch_url":"https://github.com/Tribler/tribler/pull/4090.patch","issue_url":"https://api.github.com/repos/Tribler/tribler/issues/4090","number":4090,"state":"open","locked":false,"title":"WIP-Collective Effort: Rework GUI to support GigaChannel","user":{"login":"ichorid","id":2509103,"node_id":"MDQ6VXNlcjI1MDkxMDM=","avatar_url":"https://avatars1.githubusercontent.com/u/2509103?v=4","gravatar_id":"","url":"https://api.github.com/users/ichorid","html_url":"https://github.com/ichorid","followers_url":"https://api.github.com/users/ichorid/followers","following_url":"https://api.github.com/users/ichorid/following{/other_user}","gists_url":"https://api.github.com/users/ichorid/gists{/gist_id}","starred_url":"https://api.github.com/users/ichorid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ichorid/subscriptions","organizations_url":"https://api.github.com/users/ichorid/orgs","repos_url":"https://api.github.com/users/ichorid/repos","events_url":"https://api.github.com/users/ichorid/events{/privacy}","received_events_url":"https://api.github.com/users/ichorid/received_events","type":"User","site_admin":false},"body":"This patch replaces QT List-based view of the channels and their contents with a TableView-based widget that uses QT MVC idiom The provided TableModel is capable of loading data lazily from the REST endpoint. The search endpoint is modified to send the data in small pages and do sorts and searches. The TableView serves the model with a custom Delegate. In addition, data from the old Channels implementation can be served through (ugly) dual-stack adapters in the same table.\r\n\r\nThere is a LOT of bugs to fix and work to do to finish this thing:\r\n* No unit tests provided! Feel free to add some or fix the old ones.\r\n* Piles of dead code there. The new system probably made thousands of lines of code obsolete. Please, help in removing it.\r\n* The new code is horrible. Do refactor as you please.\r\n* The table appearance actually sucks... Whatever you do to make it look better - please, do it.\r\n* Etc, etc...\r\n\r\n\r\nHaving said all that, there are only two positive sides about this PR:\r\n1. It works\r\n2. It is able to instantly search and display channel with millions of entries (tested).","created_at":"2018-12-06T18:29:16Z","updated_at":"2018-12-13T13:15:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25b9c7aa63a51bff5725c5488f74bb5cf29c63dc","assignee":null,"assignees":[],"requested_reviewers":[{"login":"devos50","id":1707075,"node_id":"MDQ6VXNlcjE3MDcwNzU=","avatar_url":"https://avatars3.githubusercontent.com/u/1707075?v=4","gravatar_id":"","url":"https://api.github.com/users/devos50","html_url":"https://github.com/devos50","followers_url":"https://api.github.com/users/devos50/followers","following_url":"https://api.github.com/users/devos50/following{/other_user}","gists_url":"https://api.github.com/users/devos50/gists{/gist_id}","starred_url":"https://api.github.com/users/devos50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devos50/subscriptions","organizations_url":"https://api.github.com/users/devos50/orgs","repos_url":"https://api.github.com/users/devos50/repos","events_url":"https://api.github.com/users/devos50/events{/privacy}","received_events_url":"https://api.github.com/users/devos50/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1022775957,"node_id":"MDU6TGFiZWwxMDIyNzc1OTU3","url":"https://api.github.com/repos/Tribler/tribler/labels/AllChannel%202.0","name":"AllChannel 2.0","color":"00FF00","default":false},{"id":29695600,"node_id":"MDU6TGFiZWwyOTY5NTYwMA==","url":"https://api.github.com/repos/Tribler/tribler/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":{"url":"https://api.github.com/repos/Tribler/tribler/milestones/28","html_url":"https://github.com/Tribler/tribler/milestone/28","labels_url":"https://api.github.com/repos/Tribler/tribler/milestones/28/labels","id":3143259,"node_id":"MDk6TWlsZXN0b25lMzE0MzI1OQ==","number":28,"title":"V7.2: Gigachannels","description":"","creator":{"login":"synctext","id":325224,"node_id":"MDQ6VXNlcjMyNTIyNA==","avatar_url":"https://avatars0.githubusercontent.com/u/325224?v=4","gravatar_id":"","url":"https://api.github.com/users/synctext","html_url":"https://github.com/synctext","followers_url":"https://api.github.com/users/synctext/followers","following_url":"https://api.github.com/users/synctext/following{/other_user}","gists_url":"https://api.github.com/users/synctext/gists{/gist_id}","starred_url":"https://api.github.com/users/synctext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/synctext/subscriptions","organizations_url":"https://api.github.com/users/synctext/orgs","repos_url":"https://api.github.com/users/synctext/repos","events_url":"https://api.github.com/users/synctext/events{/privacy}","received_events_url":"https://api.github.com/users/synctext/received_events","type":"User","site_admin":false},"open_issues":61,"closed_issues":70,"state":"open","created_at":"2018-02-26T11:04:39Z","updated_at":"2018-12-10T08:17:28Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Tribler/tribler/pulls/4090/commits","review_comments_url":"https://api.github.com/repos/Tribler/tribler/pulls/4090/comments","review_comment_url":"https://api.github.com/repos/Tribler/tribler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Tribler/tribler/issues/4090/comments","statuses_url":"https://api.github.com/repos/Tribler/tribler/statuses/75b3f8d9de6abf67299385bf8d0e4f33048e7c79","head":{"label":"Tribler:f_channelgui","ref":"f_channelgui","sha":"75b3f8d9de6abf67299385bf8d0e4f33048e7c79","user":{"login":"Tribler","id":2913489,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTM0ODk=","avatar_url":"https://avatars3.githubusercontent.com/u/2913489?v=4","gravatar_id":"","url":"https://api.github.com/users/Tribler","html_url":"https://github.com/Tribler","followers_url":"https://api.github.com/users/Tribler/followers","following_url":"https://api.github.com/users/Tribler/following{/other_user}","gists_url":"https://api.github.com/users/Tribler/gists{/gist_id}","starred_url":"https://api.github.com/users/Tribler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tribler/subscriptions","organizations_url":"https://api.github.com/users/Tribler/orgs","repos_url":"https://api.github.com/users/Tribler/repos","events_url":"https://api.github.com/users/Tribler/events{/privacy}","received_events_url":"https://api.github.com/users/Tribler/received_events","type":"Organization","site_admin":false},"repo":{"id":8411137,"node_id":"MDEwOlJlcG9zaXRvcnk4NDExMTM3","name":"tribler","full_name":"Tribler/tribler","private":false,"owner":{"login":"Tribler","id":2913489,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTM0ODk=","avatar_url":"https://avatars3.githubusercontent.com/u/2913489?v=4","gravatar_id":"","url":"https://api.github.com/users/Tribler","html_url":"https://github.com/Tribler","followers_url":"https://api.github.com/users/Tribler/followers","following_url":"https://api.github.com/users/Tribler/following{/other_user}","gists_url":"https://api.github.com/users/Tribler/gists{/gist_id}","starred_url":"https://api.github.com/users/Tribler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tribler/subscriptions","organizations_url":"https://api.github.com/users/Tribler/orgs","repos_url":"https://api.github.com/users/Tribler/repos","events_url":"https://api.github.com/users/Tribler/events{/privacy}","received_events_url":"https://api.github.com/users/Tribler/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Tribler/tribler","description":"Privacy enhanced BitTorrent client with P2P content discovery","fork":false,"url":"https://api.github.com/repos/Tribler/tribler","forks_url":"https://api.github.com/repos/Tribler/tribler/forks","keys_url":"https://api.github.com/repos/Tribler/tribler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tribler/tribler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tribler/tribler/teams","hooks_url":"https://api.github.com/repos/Tribler/tribler/hooks","issue_events_url":"https://api.github.com/repos/Tribler/tribler/issues/events{/number}","events_url":"https://api.github.com/repos/Tribler/tribler/events","assignees_url":"https://api.github.com/repos/Tribler/tribler/assignees{/user}","branches_url":"https://api.github.com/repos/Tribler/tribler/branches{/branch}","tags_url":"https://api.github.com/repos/Tribler/tribler/tags","blobs_url":"https://api.github.com/repos/Tribler/tribler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tribler/tribler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tribler/tribler/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tribler/tribler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tribler/tribler/statuses/{sha}","languages_url":"https://api.github.com/repos/Tribler/tribler/languages","stargazers_url":"https://api.github.com/repos/Tribler/tribler/stargazers","contributors_url":"https://api.github.com/repos/Tribler/tribler/contributors","subscribers_url":"https://api.github.com/repos/Tribler/tribler/subscribers","subscription_url":"https://api.github.com/repos/Tribler/tribler/subscription","commits_url":"https://api.github.com/repos/Tribler/tribler/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tribler/tribler/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tribler/tribler/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tribler/tribler/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tribler/tribler/contents/{+path}","compare_url":"https://api.github.com/repos/Tribler/tribler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tribler/tribler/merges","archive_url":"https://api.github.com/repos/Tribler/tribler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tribler/tribler/downloads","issues_url":"https://api.github.com/repos/Tribler/tribler/issues{/number}","pulls_url":"https://api.github.com/repos/Tribler/tribler/pulls{/number}","milestones_url":"https://api.github.com/repos/Tribler/tribler/milestones{/number}","notifications_url":"https://api.github.com/repos/Tribler/tribler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tribler/tribler/labels{/name}","releases_url":"https://api.github.com/repos/Tribler/tribler/releases{/id}","deployments_url":"https://api.github.com/repos/Tribler/tribler/deployments","created_at":"2013-02-25T14:51:58Z","updated_at":"2018-12-13T13:13:47Z","pushed_at":"2018-12-13T13:13:44Z","git_url":"git://github.com/Tribler/tribler.git","ssh_url":"git@github.com:Tribler/tribler.git","clone_url":"https://github.com/Tribler/tribler.git","svn_url":"https://github.com/Tribler/tribler","homepage":"http://www.tribler.org","size":123321,"stargazers_count":2751,"watchers_count":2751,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":332,"mirror_url":null,"archived":false,"open_issues_count":327,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":332,"open_issues":327,"watchers":2751,"default_branch":"devel"}},"base":{"label":"Tribler:devel","ref":"devel","sha":"98bcfdd7fab7181fab5a9e2b31bf3a2b3f845714","user":{"login":"Tribler","id":2913489,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTM0ODk=","avatar_url":"https://avatars3.githubusercontent.com/u/2913489?v=4","gravatar_id":"","url":"https://api.github.com/users/Tribler","html_url":"https://github.com/Tribler","followers_url":"https://api.github.com/users/Tribler/followers","following_url":"https://api.github.com/users/Tribler/following{/other_user}","gists_url":"https://api.github.com/users/Tribler/gists{/gist_id}","starred_url":"https://api.github.com/users/Tribler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tribler/subscriptions","organizations_url":"https://api.github.com/users/Tribler/orgs","repos_url":"https://api.github.com/users/Tribler/repos","events_url":"https://api.github.com/users/Tribler/events{/privacy}","received_events_url":"https://api.github.com/users/Tribler/received_events","type":"Organization","site_admin":false},"repo":{"id":8411137,"node_id":"MDEwOlJlcG9zaXRvcnk4NDExMTM3","name":"tribler","full_name":"Tribler/tribler","private":false,"owner":{"login":"Tribler","id":2913489,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTM0ODk=","avatar_url":"https://avatars3.githubusercontent.com/u/2913489?v=4","gravatar_id":"","url":"https://api.github.com/users/Tribler","html_url":"https://github.com/Tribler","followers_url":"https://api.github.com/users/Tribler/followers","following_url":"https://api.github.com/users/Tribler/following{/other_user}","gists_url":"https://api.github.com/users/Tribler/gists{/gist_id}","starred_url":"https://api.github.com/users/Tribler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tribler/subscriptions","organizations_url":"https://api.github.com/users/Tribler/orgs","repos_url":"https://api.github.com/users/Tribler/repos","events_url":"https://api.github.com/users/Tribler/events{/privacy}","received_events_url":"https://api.github.com/users/Tribler/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Tribler/tribler","description":"Privacy enhanced BitTorrent client with P2P content discovery","fork":false,"url":"https://api.github.com/repos/Tribler/tribler","forks_url":"https://api.github.com/repos/Tribler/tribler/forks","keys_url":"https://api.github.com/repos/Tribler/tribler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tribler/tribler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tribler/tribler/teams","hooks_url":"https://api.github.com/repos/Tribler/tribler/hooks","issue_events_url":"https://api.github.com/repos/Tribler/tribler/issues/events{/number}","events_url":"https://api.github.com/repos/Tribler/tribler/events","assignees_url":"https://api.github.com/repos/Tribler/tribler/assignees{/user}","branches_url":"https://api.github.com/repos/Tribler/tribler/branches{/branch}","tags_url":"https://api.github.com/repos/Tribler/tribler/tags","blobs_url":"https://api.github.com/repos/Tribler/tribler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tribler/tribler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tribler/tribler/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tribler/tribler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tribler/tribler/statuses/{sha}","languages_url":"https://api.github.com/repos/Tribler/tribler/languages","stargazers_url":"https://api.github.com/repos/Tribler/tribler/stargazers","contributors_url":"https://api.github.com/repos/Tribler/tribler/contributors","subscribers_url":"https://api.github.com/repos/Tribler/tribler/subscribers","subscription_url":"https://api.github.com/repos/Tribler/tribler/subscription","commits_url":"https://api.github.com/repos/Tribler/tribler/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tribler/tribler/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tribler/tribler/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tribler/tribler/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tribler/tribler/contents/{+path}","compare_url":"https://api.github.com/repos/Tribler/tribler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tribler/tribler/merges","archive_url":"https://api.github.com/repos/Tribler/tribler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tribler/tribler/downloads","issues_url":"https://api.github.com/repos/Tribler/tribler/issues{/number}","pulls_url":"https://api.github.com/repos/Tribler/tribler/pulls{/number}","milestones_url":"https://api.github.com/repos/Tribler/tribler/milestones{/number}","notifications_url":"https://api.github.com/repos/Tribler/tribler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tribler/tribler/labels{/name}","releases_url":"https://api.github.com/repos/Tribler/tribler/releases{/id}","deployments_url":"https://api.github.com/repos/Tribler/tribler/deployments","created_at":"2013-02-25T14:51:58Z","updated_at":"2018-12-13T13:13:47Z","pushed_at":"2018-12-13T13:13:44Z","git_url":"git://github.com/Tribler/tribler.git","ssh_url":"git@github.com:Tribler/tribler.git","clone_url":"https://github.com/Tribler/tribler.git","svn_url":"https://github.com/Tribler/tribler","homepage":"http://www.tribler.org","size":123321,"stargazers_count":2751,"watchers_count":2751,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":332,"mirror_url":null,"archived":false,"open_issues_count":327,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":332,"open_issues":327,"watchers":2751,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/Tribler/tribler/pulls/4090"},"html":{"href":"https://github.com/Tribler/tribler/pull/4090"},"issue":{"href":"https://api.github.com/repos/Tribler/tribler/issues/4090"},"comments":{"href":"https://api.github.com/repos/Tribler/tribler/issues/4090/comments"},"review_comments":{"href":"https://api.github.com/repos/Tribler/tribler/pulls/4090/comments"},"review_comment":{"href":"https://api.github.com/repos/Tribler/tribler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Tribler/tribler/pulls/4090/commits"},"statuses":{"href":"https://api.github.com/repos/Tribler/tribler/statuses/75b3f8d9de6abf67299385bf8d0e4f33048e7c79"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ichorid"}}