{"action":"created","comment":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments/25497349","id":25497349,"diff_hunk":"@@ -135,6 +145,90 @@ window.addEvent('load', function () {\n     var syncMainDataLastResponseId = 0;\n     var serverState = {};\n \n+    var removeTorrentFromLabelList = function( hash )\n+    {\n+        if( hash == null || hash == \"\" ) return false;\n+\n+        var removed = false;\n+        Object.each( label_list, function( label ) {\n+            if( Object.contains( label.torrents, hash ) ) {\n+                removed = true;\n+                label.torrents.splice( label.torrents.indexOf( hash ), 1 );\n+            }\n+        });\n+        return removed;\n+    };\n+\n+    var addTorrentToLabelList = function( torrent ) {\n+        var label = torrent['label'];\n+        if( label == null || label.length === 0 ) {\n+            removeTorrentFromLabelList( torrent['hash'] );\n+            return false;\n+        }\n+\n+        var labelHash = genHash( label );\n+        if( label_list[labelHash] == null ) {\n+            console.log( \"addTorrentToLabelList: warning, label not found. label=\", label, \" label_list=\", label_list );","path":"src/webui/www/public/scripts/client.js","position":85,"original_position":51,"commit_id":"086f0a1901d458b3aad6e7458fa4bd30a7de0731","original_commit_id":"6d4c87abfa5216f854329f0433be700d4ed8f6c8","user":{"login":"pmzqla","id":6256149,"avatar_url":"https://avatars.githubusercontent.com/u/6256149?v=3","gravatar_id":"","url":"https://api.github.com/users/pmzqla","html_url":"https://github.com/pmzqla","followers_url":"https://api.github.com/users/pmzqla/followers","following_url":"https://api.github.com/users/pmzqla/following{/other_user}","gists_url":"https://api.github.com/users/pmzqla/gists{/gist_id}","starred_url":"https://api.github.com/users/pmzqla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmzqla/subscriptions","organizations_url":"https://api.github.com/users/pmzqla/orgs","repos_url":"https://api.github.com/users/pmzqla/repos","events_url":"https://api.github.com/users/pmzqla/events{/privacy}","received_events_url":"https://api.github.com/users/pmzqla/received_events","type":"User","site_admin":false},"body":"Yes. `console.log` should be used only while developing.","created_at":"2015-02-27T10:08:20Z","updated_at":"2015-02-27T10:08:20Z","html_url":"https://github.com/qbittorrent/qBittorrent/pull/2558#discussion_r25497349","pull_request_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/2558","_links":{"self":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments/25497349"},"html":{"href":"https://github.com/qbittorrent/qBittorrent/pull/2558#discussion_r25497349"},"pull_request":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/2558"}}},"pull_request":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/2558","id":29329819,"html_url":"https://github.com/qbittorrent/qBittorrent/pull/2558","diff_url":"https://github.com/qbittorrent/qBittorrent/pull/2558.diff","patch_url":"https://github.com/qbittorrent/qBittorrent/pull/2558.patch","issue_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/2558","number":2558,"state":"open","locked":false,"title":"webui: Basic label support c++ & js","user":{"login":"fbarriga","id":718207,"avatar_url":"https://avatars.githubusercontent.com/u/718207?v=3","gravatar_id":"","url":"https://api.github.com/users/fbarriga","html_url":"https://github.com/fbarriga","followers_url":"https://api.github.com/users/fbarriga/followers","following_url":"https://api.github.com/users/fbarriga/following{/other_user}","gists_url":"https://api.github.com/users/fbarriga/gists{/gist_id}","starred_url":"https://api.github.com/users/fbarriga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbarriga/subscriptions","organizations_url":"https://api.github.com/users/fbarriga/orgs","repos_url":"https://api.github.com/users/fbarriga/repos","events_url":"https://api.github.com/users/fbarriga/events{/privacy}","received_events_url":"https://api.github.com/users/fbarriga/received_events","type":"User","site_admin":false},"body":"**UPDATED 2015-02-15**\r\nreference ticket: #648\r\nChanges:\r\n- Add support on the c++ code to assign labels to torrents from webui\r\n- Display labels of torrents on the webui\r\n- Display list of all labels on webui (on filters)\r\n- Assign/create labels to torrents on the webui\r\n- Filter displayed torrents by label","created_at":"2015-02-15T04:16:17Z","updated_at":"2015-02-27T10:08:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0bcc425b0815339ceba6357550267e8653037f1b","assignee":null,"milestone":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/milestones/14","html_url":"https://github.com/qbittorrent/qBittorrent/milestones/v3.2.0","labels_url":"https://api.github.com/repos/qbittorrent/qBittorrent/milestones/14/labels","id":463705,"number":14,"title":"v3.2.0","description":"","creator":{"login":"sledgehammer999","id":273315,"avatar_url":"https://avatars.githubusercontent.com/u/273315?v=3","gravatar_id":"","url":"https://api.github.com/users/sledgehammer999","html_url":"https://github.com/sledgehammer999","followers_url":"https://api.github.com/users/sledgehammer999/followers","following_url":"https://api.github.com/users/sledgehammer999/following{/other_user}","gists_url":"https://api.github.com/users/sledgehammer999/gists{/gist_id}","starred_url":"https://api.github.com/users/sledgehammer999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sledgehammer999/subscriptions","organizations_url":"https://api.github.com/users/sledgehammer999/orgs","repos_url":"https://api.github.com/users/sledgehammer999/repos","events_url":"https://api.github.com/users/sledgehammer999/events{/privacy}","received_events_url":"https://api.github.com/users/sledgehammer999/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":33,"state":"open","created_at":"2013-10-24T15:10:27Z","updated_at":"2015-02-26T21:59:05Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/2558/commits","review_comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/2558/comments","review_comment_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/2558/comments","statuses_url":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/086f0a1901d458b3aad6e7458fa4bd30a7de0731","head":{"label":"fbarriga:fbarriga/label/3","ref":"fbarriga/label/3","sha":"086f0a1901d458b3aad6e7458fa4bd30a7de0731","user":{"login":"fbarriga","id":718207,"avatar_url":"https://avatars.githubusercontent.com/u/718207?v=3","gravatar_id":"","url":"https://api.github.com/users/fbarriga","html_url":"https://github.com/fbarriga","followers_url":"https://api.github.com/users/fbarriga/followers","following_url":"https://api.github.com/users/fbarriga/following{/other_user}","gists_url":"https://api.github.com/users/fbarriga/gists{/gist_id}","starred_url":"https://api.github.com/users/fbarriga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbarriga/subscriptions","organizations_url":"https://api.github.com/users/fbarriga/orgs","repos_url":"https://api.github.com/users/fbarriga/repos","events_url":"https://api.github.com/users/fbarriga/events{/privacy}","received_events_url":"https://api.github.com/users/fbarriga/received_events","type":"User","site_admin":false},"repo":{"id":28752182,"name":"qBittorrent","full_name":"fbarriga/qBittorrent","owner":{"login":"fbarriga","id":718207,"avatar_url":"https://avatars.githubusercontent.com/u/718207?v=3","gravatar_id":"","url":"https://api.github.com/users/fbarriga","html_url":"https://github.com/fbarriga","followers_url":"https://api.github.com/users/fbarriga/followers","following_url":"https://api.github.com/users/fbarriga/following{/other_user}","gists_url":"https://api.github.com/users/fbarriga/gists{/gist_id}","starred_url":"https://api.github.com/users/fbarriga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbarriga/subscriptions","organizations_url":"https://api.github.com/users/fbarriga/orgs","repos_url":"https://api.github.com/users/fbarriga/repos","events_url":"https://api.github.com/users/fbarriga/events{/privacy}","received_events_url":"https://api.github.com/users/fbarriga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fbarriga/qBittorrent","description":"qBittorrent BitTorrent client","fork":true,"url":"https://api.github.com/repos/fbarriga/qBittorrent","forks_url":"https://api.github.com/repos/fbarriga/qBittorrent/forks","keys_url":"https://api.github.com/repos/fbarriga/qBittorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fbarriga/qBittorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fbarriga/qBittorrent/teams","hooks_url":"https://api.github.com/repos/fbarriga/qBittorrent/hooks","issue_events_url":"https://api.github.com/repos/fbarriga/qBittorrent/issues/events{/number}","events_url":"https://api.github.com/repos/fbarriga/qBittorrent/events","assignees_url":"https://api.github.com/repos/fbarriga/qBittorrent/assignees{/user}","branches_url":"https://api.github.com/repos/fbarriga/qBittorrent/branches{/branch}","tags_url":"https://api.github.com/repos/fbarriga/qBittorrent/tags","blobs_url":"https://api.github.com/repos/fbarriga/qBittorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fbarriga/qBittorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fbarriga/qBittorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/fbarriga/qBittorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fbarriga/qBittorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/fbarriga/qBittorrent/languages","stargazers_url":"https://api.github.com/repos/fbarriga/qBittorrent/stargazers","contributors_url":"https://api.github.com/repos/fbarriga/qBittorrent/contributors","subscribers_url":"https://api.github.com/repos/fbarriga/qBittorrent/subscribers","subscription_url":"https://api.github.com/repos/fbarriga/qBittorrent/subscription","commits_url":"https://api.github.com/repos/fbarriga/qBittorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/fbarriga/qBittorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/fbarriga/qBittorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/fbarriga/qBittorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/fbarriga/qBittorrent/contents/{+path}","compare_url":"https://api.github.com/repos/fbarriga/qBittorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fbarriga/qBittorrent/merges","archive_url":"https://api.github.com/repos/fbarriga/qBittorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fbarriga/qBittorrent/downloads","issues_url":"https://api.github.com/repos/fbarriga/qBittorrent/issues{/number}","pulls_url":"https://api.github.com/repos/fbarriga/qBittorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/fbarriga/qBittorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/fbarriga/qBittorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fbarriga/qBittorrent/labels{/name}","releases_url":"https://api.github.com/repos/fbarriga/qBittorrent/releases{/id}","created_at":"2015-01-03T19:10:14Z","updated_at":"2015-01-26T12:26:52Z","pushed_at":"2015-02-27T03:15:23Z","git_url":"git://github.com/fbarriga/qBittorrent.git","ssh_url":"git@github.com:fbarriga/qBittorrent.git","clone_url":"https://github.com/fbarriga/qBittorrent.git","svn_url":"https://github.com/fbarriga/qBittorrent","homepage":"http://www.qbittorrent.org","size":102374,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"qbittorrent:master","ref":"master","sha":"112d4b8c713a673815102b172839c63849f3f834","user":{"login":"qbittorrent","id":2131270,"avatar_url":"https://avatars.githubusercontent.com/u/2131270?v=3","gravatar_id":"","url":"https://api.github.com/users/qbittorrent","html_url":"https://github.com/qbittorrent","followers_url":"https://api.github.com/users/qbittorrent/followers","following_url":"https://api.github.com/users/qbittorrent/following{/other_user}","gists_url":"https://api.github.com/users/qbittorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/qbittorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qbittorrent/subscriptions","organizations_url":"https://api.github.com/users/qbittorrent/orgs","repos_url":"https://api.github.com/users/qbittorrent/repos","events_url":"https://api.github.com/users/qbittorrent/events{/privacy}","received_events_url":"https://api.github.com/users/qbittorrent/received_events","type":"Organization","site_admin":false},"repo":{"id":3351871,"name":"qBittorrent","full_name":"qbittorrent/qBittorrent","owner":{"login":"qbittorrent","id":2131270,"avatar_url":"https://avatars.githubusercontent.com/u/2131270?v=3","gravatar_id":"","url":"https://api.github.com/users/qbittorrent","html_url":"https://github.com/qbittorrent","followers_url":"https://api.github.com/users/qbittorrent/followers","following_url":"https://api.github.com/users/qbittorrent/following{/other_user}","gists_url":"https://api.github.com/users/qbittorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/qbittorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qbittorrent/subscriptions","organizations_url":"https://api.github.com/users/qbittorrent/orgs","repos_url":"https://api.github.com/users/qbittorrent/repos","events_url":"https://api.github.com/users/qbittorrent/events{/privacy}","received_events_url":"https://api.github.com/users/qbittorrent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qbittorrent/qBittorrent","description":"qBittorrent BitTorrent client","fork":false,"url":"https://api.github.com/repos/qbittorrent/qBittorrent","forks_url":"https://api.github.com/repos/qbittorrent/qBittorrent/forks","keys_url":"https://api.github.com/repos/qbittorrent/qBittorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qbittorrent/qBittorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qbittorrent/qBittorrent/teams","hooks_url":"https://api.github.com/repos/qbittorrent/qBittorrent/hooks","issue_events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/events{/number}","events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/events","assignees_url":"https://api.github.com/repos/qbittorrent/qBittorrent/assignees{/user}","branches_url":"https://api.github.com/repos/qbittorrent/qBittorrent/branches{/branch}","tags_url":"https://api.github.com/repos/qbittorrent/qBittorrent/tags","blobs_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/qbittorrent/qBittorrent/languages","stargazers_url":"https://api.github.com/repos/qbittorrent/qBittorrent/stargazers","contributors_url":"https://api.github.com/repos/qbittorrent/qBittorrent/contributors","subscribers_url":"https://api.github.com/repos/qbittorrent/qBittorrent/subscribers","subscription_url":"https://api.github.com/repos/qbittorrent/qBittorrent/subscription","commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/qbittorrent/qBittorrent/contents/{+path}","compare_url":"https://api.github.com/repos/qbittorrent/qBittorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qbittorrent/qBittorrent/merges","archive_url":"https://api.github.com/repos/qbittorrent/qBittorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qbittorrent/qBittorrent/downloads","issues_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues{/number}","pulls_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/qbittorrent/qBittorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/qbittorrent/qBittorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qbittorrent/qBittorrent/labels{/name}","releases_url":"https://api.github.com/repos/qbittorrent/qBittorrent/releases{/id}","created_at":"2012-02-04T09:37:46Z","updated_at":"2015-02-26T21:55:46Z","pushed_at":"2015-02-26T16:46:36Z","git_url":"git://github.com/qbittorrent/qBittorrent.git","ssh_url":"git@github.com:qbittorrent/qBittorrent.git","clone_url":"https://github.com/qbittorrent/qBittorrent.git","svn_url":"https://github.com/qbittorrent/qBittorrent","homepage":"http://www.qbittorrent.org","size":114072,"stargazers_count":724,"watchers_count":724,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":238,"mirror_url":null,"open_issues_count":805,"forks":238,"open_issues":805,"watchers":724,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/2558"},"html":{"href":"https://github.com/qbittorrent/qBittorrent/pull/2558"},"issue":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/2558"},"comments":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/2558/comments"},"review_comments":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/2558/comments"},"review_comment":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/2558/commits"},"statuses":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/086f0a1901d458b3aad6e7458fa4bd30a7de0731"}}}}