{"action":"created","comment":{"url":"https://api.github.com/repos/WFCD/tennotv/pulls/comments/220077967","pull_request_review_id":158400674,"id":220077967,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDA3Nzk2Nw==","diff_hunk":"@@ -104,3 +107,59 @@ function startVideo(videoId) {\n     loadVideo(videoId);\n   }\n }\n+\n+function likeVideo() {\n+  var videoId = player.getVideoData().video_id;\n+  // If the like button already has the 'liked' class and is pressed,\n+  // send the 'none' rating instead to undo the like (otherwise, like the video via post)\n+  if ($('#playerLike').hasClass('liked')) {\n+    var postUrl = 'https://www.googleapis.com/youtube/v3/videos/rate?id='+videoId+'&rating=none&key='+api_key+'&access_token='\n+    tryAuthenticateAndPost(postUrl)\n+    $('#playerLike').removeClass('liked')\n+  } else {\n+    var postUrl = 'https://www.googleapis.com/youtube/v3/videos/rate?id='+videoId+'&rating=like&key='+api_key+'&access_token='\n+    tryAuthenticateAndPost(postUrl)\n+    $('#playerLike').addClass('liked')\n+    $('#playerDislike').removeClass('disliked')\n+  }\n+}\n+\n+function dislikeVideo() {\n+  var videoId = player.getVideoData().video_id\n+  // If the dislike button already has the 'disliked' class and is pressed,\n+  // send the 'none' rating instead to undo the dislike (otherwise, dislike the video via post)\n+  if ($('#playerDislike').hasClass('disliked')) {\n+    var postUrl = 'https://www.googleapis.com/youtube/v3/videos/rate?id='+videoId+'&rating=none&key='+api_key+'&access_token='\n+    tryAuthenticateAndPost(postUrl)\n+    $('#playerDislike').removeClass('disliked')\n+  } else {\n+    var postUrl = 'https://www.googleapis.com/youtube/v3/videos/rate?id='+videoId+'&rating=dislike&key='+api_key+'&access_token='","path":"assets/js/playerControl.js","position":44,"original_position":44,"commit_id":"7225932553951965e04fc407caa26e8e7e3bbf08","original_commit_id":"7225932553951965e04fc407caa26e8e7e3bbf08","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Unexpected string concatenation. (prefer-template)](https://app.codacy.com/app/WFCD/tennotv/pullRequest?prid=2244588)","created_at":"2018-09-25T07:04:28Z","updated_at":"2018-09-25T07:04:28Z","html_url":"https://github.com/WFCD/tennotv/pull/29#discussion_r220077967","pull_request_url":"https://api.github.com/repos/WFCD/tennotv/pulls/29","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/WFCD/tennotv/pulls/comments/220077967"},"html":{"href":"https://github.com/WFCD/tennotv/pull/29#discussion_r220077967"},"pull_request":{"href":"https://api.github.com/repos/WFCD/tennotv/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/WFCD/tennotv/pulls/29","id":217874097,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3ODc0MDk3","html_url":"https://github.com/WFCD/tennotv/pull/29","diff_url":"https://github.com/WFCD/tennotv/pull/29.diff","patch_url":"https://github.com/WFCD/tennotv/pull/29.patch","issue_url":"https://api.github.com/repos/WFCD/tennotv/issues/29","number":29,"state":"open","locked":false,"title":"Feature/like dislike buttons","user":{"login":"IronChariot","id":8061483,"node_id":"MDQ6VXNlcjgwNjE0ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/8061483?v=4","gravatar_id":"","url":"https://api.github.com/users/IronChariot","html_url":"https://github.com/IronChariot","followers_url":"https://api.github.com/users/IronChariot/followers","following_url":"https://api.github.com/users/IronChariot/following{/other_user}","gists_url":"https://api.github.com/users/IronChariot/gists{/gist_id}","starred_url":"https://api.github.com/users/IronChariot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IronChariot/subscriptions","organizations_url":"https://api.github.com/users/IronChariot/orgs","repos_url":"https://api.github.com/users/IronChariot/repos","events_url":"https://api.github.com/users/IronChariot/events{/privacy}","received_events_url":"https://api.github.com/users/IronChariot/received_events","type":"User","site_admin":false},"body":"### Tenno.tv Pull Request\r\n\r\n---\r\n\r\n**What I did:**\r\nAdded code to dependencies and player controls to add 'like' and 'dislike' buttons above videos which use Youtube's API. Added like and dislike buttons to the controls partial, and some styling for the buttons to the styles css file.\r\n\r\n---\r\n**Why I did it:**\r\nSo that users can authorise and put a rating against a video they are watching without having to go to Youtube.\r\n\r\n---\r\n**Fixes issue (include link):**\r\nNA\r\n\r\n---\r\n**Mockups, screenshots, evidence:**\r\nDemoed to Xeno.\r\n\r\n---\r\n\r\n**Was this an issue fix or a suggestion fulfillment?**\r\nSuggestion fulfillment","created_at":"2018-09-25T07:01:19Z","updated_at":"2018-09-25T07:04:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02a037b47a100e187b384fa4fb89c026223dbe3a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/WFCD/tennotv/pulls/29/commits","review_comments_url":"https://api.github.com/repos/WFCD/tennotv/pulls/29/comments","review_comment_url":"https://api.github.com/repos/WFCD/tennotv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WFCD/tennotv/issues/29/comments","statuses_url":"https://api.github.com/repos/WFCD/tennotv/statuses/7225932553951965e04fc407caa26e8e7e3bbf08","head":{"label":"WFCD:feature/like-dislike-buttons","ref":"feature/like-dislike-buttons","sha":"7225932553951965e04fc407caa26e8e7e3bbf08","user":{"login":"WFCD","id":24436369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NDM2MzY5","avatar_url":"https://avatars0.githubusercontent.com/u/24436369?v=4","gravatar_id":"","url":"https://api.github.com/users/WFCD","html_url":"https://github.com/WFCD","followers_url":"https://api.github.com/users/WFCD/followers","following_url":"https://api.github.com/users/WFCD/following{/other_user}","gists_url":"https://api.github.com/users/WFCD/gists{/gist_id}","starred_url":"https://api.github.com/users/WFCD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WFCD/subscriptions","organizations_url":"https://api.github.com/users/WFCD/orgs","repos_url":"https://api.github.com/users/WFCD/repos","events_url":"https://api.github.com/users/WFCD/events{/privacy}","received_events_url":"https://api.github.com/users/WFCD/received_events","type":"Organization","site_admin":false},"repo":{"id":135632354,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU2MzIzNTQ=","name":"tennotv","full_name":"WFCD/tennotv","private":false,"owner":{"login":"WFCD","id":24436369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NDM2MzY5","avatar_url":"https://avatars0.githubusercontent.com/u/24436369?v=4","gravatar_id":"","url":"https://api.github.com/users/WFCD","html_url":"https://github.com/WFCD","followers_url":"https://api.github.com/users/WFCD/followers","following_url":"https://api.github.com/users/WFCD/following{/other_user}","gists_url":"https://api.github.com/users/WFCD/gists{/gist_id}","starred_url":"https://api.github.com/users/WFCD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WFCD/subscriptions","organizations_url":"https://api.github.com/users/WFCD/orgs","repos_url":"https://api.github.com/users/WFCD/repos","events_url":"https://api.github.com/users/WFCD/events{/privacy}","received_events_url":"https://api.github.com/users/WFCD/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/WFCD/tennotv","description":"Location for contribution and Issue management","fork":false,"url":"https://api.github.com/repos/WFCD/tennotv","forks_url":"https://api.github.com/repos/WFCD/tennotv/forks","keys_url":"https://api.github.com/repos/WFCD/tennotv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WFCD/tennotv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WFCD/tennotv/teams","hooks_url":"https://api.github.com/repos/WFCD/tennotv/hooks","issue_events_url":"https://api.github.com/repos/WFCD/tennotv/issues/events{/number}","events_url":"https://api.github.com/repos/WFCD/tennotv/events","assignees_url":"https://api.github.com/repos/WFCD/tennotv/assignees{/user}","branches_url":"https://api.github.com/repos/WFCD/tennotv/branches{/branch}","tags_url":"https://api.github.com/repos/WFCD/tennotv/tags","blobs_url":"https://api.github.com/repos/WFCD/tennotv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WFCD/tennotv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WFCD/tennotv/git/refs{/sha}","trees_url":"https://api.github.com/repos/WFCD/tennotv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WFCD/tennotv/statuses/{sha}","languages_url":"https://api.github.com/repos/WFCD/tennotv/languages","stargazers_url":"https://api.github.com/repos/WFCD/tennotv/stargazers","contributors_url":"https://api.github.com/repos/WFCD/tennotv/contributors","subscribers_url":"https://api.github.com/repos/WFCD/tennotv/subscribers","subscription_url":"https://api.github.com/repos/WFCD/tennotv/subscription","commits_url":"https://api.github.com/repos/WFCD/tennotv/commits{/sha}","git_commits_url":"https://api.github.com/repos/WFCD/tennotv/git/commits{/sha}","comments_url":"https://api.github.com/repos/WFCD/tennotv/comments{/number}","issue_comment_url":"https://api.github.com/repos/WFCD/tennotv/issues/comments{/number}","contents_url":"https://api.github.com/repos/WFCD/tennotv/contents/{+path}","compare_url":"https://api.github.com/repos/WFCD/tennotv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WFCD/tennotv/merges","archive_url":"https://api.github.com/repos/WFCD/tennotv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WFCD/tennotv/downloads","issues_url":"https://api.github.com/repos/WFCD/tennotv/issues{/number}","pulls_url":"https://api.github.com/repos/WFCD/tennotv/pulls{/number}","milestones_url":"https://api.github.com/repos/WFCD/tennotv/milestones{/number}","notifications_url":"https://api.github.com/repos/WFCD/tennotv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WFCD/tennotv/labels{/name}","releases_url":"https://api.github.com/repos/WFCD/tennotv/releases{/id}","deployments_url":"https://api.github.com/repos/WFCD/tennotv/deployments","created_at":"2018-05-31T20:30:28Z","updated_at":"2018-09-12T14:05:16Z","pushed_at":"2018-09-25T07:01:19Z","git_url":"git://github.com/WFCD/tennotv.git","ssh_url":"git@github.com:WFCD/tennotv.git","clone_url":"https://github.com/WFCD/tennotv.git","svn_url":"https://github.com/WFCD/tennotv","homepage":null,"size":1318,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"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":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"WFCD:master","ref":"master","sha":"f2e0e8052b5d4dc33fd6ba8e9506d375130f7b93","user":{"login":"WFCD","id":24436369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NDM2MzY5","avatar_url":"https://avatars0.githubusercontent.com/u/24436369?v=4","gravatar_id":"","url":"https://api.github.com/users/WFCD","html_url":"https://github.com/WFCD","followers_url":"https://api.github.com/users/WFCD/followers","following_url":"https://api.github.com/users/WFCD/following{/other_user}","gists_url":"https://api.github.com/users/WFCD/gists{/gist_id}","starred_url":"https://api.github.com/users/WFCD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WFCD/subscriptions","organizations_url":"https://api.github.com/users/WFCD/orgs","repos_url":"https://api.github.com/users/WFCD/repos","events_url":"https://api.github.com/users/WFCD/events{/privacy}","received_events_url":"https://api.github.com/users/WFCD/received_events","type":"Organization","site_admin":false},"repo":{"id":135632354,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU2MzIzNTQ=","name":"tennotv","full_name":"WFCD/tennotv","private":false,"owner":{"login":"WFCD","id":24436369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NDM2MzY5","avatar_url":"https://avatars0.githubusercontent.com/u/24436369?v=4","gravatar_id":"","url":"https://api.github.com/users/WFCD","html_url":"https://github.com/WFCD","followers_url":"https://api.github.com/users/WFCD/followers","following_url":"https://api.github.com/users/WFCD/following{/other_user}","gists_url":"https://api.github.com/users/WFCD/gists{/gist_id}","starred_url":"https://api.github.com/users/WFCD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WFCD/subscriptions","organizations_url":"https://api.github.com/users/WFCD/orgs","repos_url":"https://api.github.com/users/WFCD/repos","events_url":"https://api.github.com/users/WFCD/events{/privacy}","received_events_url":"https://api.github.com/users/WFCD/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/WFCD/tennotv","description":"Location for contribution and Issue management","fork":false,"url":"https://api.github.com/repos/WFCD/tennotv","forks_url":"https://api.github.com/repos/WFCD/tennotv/forks","keys_url":"https://api.github.com/repos/WFCD/tennotv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WFCD/tennotv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WFCD/tennotv/teams","hooks_url":"https://api.github.com/repos/WFCD/tennotv/hooks","issue_events_url":"https://api.github.com/repos/WFCD/tennotv/issues/events{/number}","events_url":"https://api.github.com/repos/WFCD/tennotv/events","assignees_url":"https://api.github.com/repos/WFCD/tennotv/assignees{/user}","branches_url":"https://api.github.com/repos/WFCD/tennotv/branches{/branch}","tags_url":"https://api.github.com/repos/WFCD/tennotv/tags","blobs_url":"https://api.github.com/repos/WFCD/tennotv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WFCD/tennotv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WFCD/tennotv/git/refs{/sha}","trees_url":"https://api.github.com/repos/WFCD/tennotv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WFCD/tennotv/statuses/{sha}","languages_url":"https://api.github.com/repos/WFCD/tennotv/languages","stargazers_url":"https://api.github.com/repos/WFCD/tennotv/stargazers","contributors_url":"https://api.github.com/repos/WFCD/tennotv/contributors","subscribers_url":"https://api.github.com/repos/WFCD/tennotv/subscribers","subscription_url":"https://api.github.com/repos/WFCD/tennotv/subscription","commits_url":"https://api.github.com/repos/WFCD/tennotv/commits{/sha}","git_commits_url":"https://api.github.com/repos/WFCD/tennotv/git/commits{/sha}","comments_url":"https://api.github.com/repos/WFCD/tennotv/comments{/number}","issue_comment_url":"https://api.github.com/repos/WFCD/tennotv/issues/comments{/number}","contents_url":"https://api.github.com/repos/WFCD/tennotv/contents/{+path}","compare_url":"https://api.github.com/repos/WFCD/tennotv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WFCD/tennotv/merges","archive_url":"https://api.github.com/repos/WFCD/tennotv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WFCD/tennotv/downloads","issues_url":"https://api.github.com/repos/WFCD/tennotv/issues{/number}","pulls_url":"https://api.github.com/repos/WFCD/tennotv/pulls{/number}","milestones_url":"https://api.github.com/repos/WFCD/tennotv/milestones{/number}","notifications_url":"https://api.github.com/repos/WFCD/tennotv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WFCD/tennotv/labels{/name}","releases_url":"https://api.github.com/repos/WFCD/tennotv/releases{/id}","deployments_url":"https://api.github.com/repos/WFCD/tennotv/deployments","created_at":"2018-05-31T20:30:28Z","updated_at":"2018-09-12T14:05:16Z","pushed_at":"2018-09-25T07:01:19Z","git_url":"git://github.com/WFCD/tennotv.git","ssh_url":"git@github.com:WFCD/tennotv.git","clone_url":"https://github.com/WFCD/tennotv.git","svn_url":"https://github.com/WFCD/tennotv","homepage":null,"size":1318,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"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":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WFCD/tennotv/pulls/29"},"html":{"href":"https://github.com/WFCD/tennotv/pull/29"},"issue":{"href":"https://api.github.com/repos/WFCD/tennotv/issues/29"},"comments":{"href":"https://api.github.com/repos/WFCD/tennotv/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/WFCD/tennotv/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/WFCD/tennotv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WFCD/tennotv/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/WFCD/tennotv/statuses/7225932553951965e04fc407caa26e8e7e3bbf08"}},"author_association":"NONE"}}
{"actor":{"display_login":"codacy-bot"}}