{"action":"created","comment":{"url":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/comments/115527118","pull_request_review_id":37072596,"id":115527118,"diff_hunk":"@@ -0,0 +1,56 @@\n+# -*- coding: utf-8 -*-\n+#\n+# This file is part of Invenio.\n+# Copyright (C) 2017 CERN.\n+#\n+# Invenio is free software; you can redistribute it\n+# and/or modify it under the terms of the GNU General Public License as\n+# published by the Free Software Foundation; either version 2 of the\n+# License, or (at your option) any later version.\n+#\n+# Invenio is distributed in the hope that it will be\n+# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+# General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with Invenio; if not, write to the\n+# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,\n+# MA 02111-1307, USA.\n+#\n+# In applying this license, CERN does not\n+# waive the privileges and immunities granted to it by virtue of its status\n+# as an Intergovernmental Organization or submit itself to any jurisdiction.\n+\n+\"\"\"Links for record serialization.\"\"\"\n+\n+from __future__ import absolute_import, print_function\n+\n+from invenio_records_rest.links import default_links_factory\n+\n+from .resolver import record_resolver\n+from ..deposit.api import deposit_project_resolver\n+\n+\n+def _fill_video_extra_links(record, links):\n+    \"\"\"Add extra links if it's a video.\"\"\"\n+    if '_project_id' in record:\n+        # if it's a video, get the deposit project\n+        deposit_project = deposit_project_resolver(record['_project_id'])\n+        if deposit_project.is_published():\n+            # if the project is published, get the record project\n+            pid_project, record_project = deposit_project.fetch_published()\n+            # include project link, title\n+            links['project'] = {\n+                'links': default_links_factory(pid_project),\n+                'title': record_project.get('title', '')","path":"cds/modules/records/links.py","position":46,"original_position":46,"commit_id":"2e1494b05270a027d6cbc7f92d01b09645051aee","original_commit_id":"2e1494b05270a027d6cbc7f92d01b09645051aee","user":{"login":"drjova","id":4287772,"avatar_url":"https://avatars0.githubusercontent.com/u/4287772?v=3","gravatar_id":"","url":"https://api.github.com/users/drjova","html_url":"https://github.com/drjova","followers_url":"https://api.github.com/users/drjova/followers","following_url":"https://api.github.com/users/drjova/following{/other_user}","gists_url":"https://api.github.com/users/drjova/gists{/gist_id}","starred_url":"https://api.github.com/users/drjova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drjova/subscriptions","organizations_url":"https://api.github.com/users/drjova/orgs","repos_url":"https://api.github.com/users/drjova/repos","events_url":"https://api.github.com/users/drjova/events{/privacy}","received_events_url":"https://api.github.com/users/drjova/received_events","type":"User","site_admin":false},"body":"It's better to keep links clean (i.e. without the title), WDYT?","created_at":"2017-05-09T15:51:50Z","updated_at":"2017-05-09T15:51:50Z","html_url":"https://github.com/CERNDocumentServer/cds/pull/803#discussion_r115527118","pull_request_url":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/803","_links":{"self":{"href":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/comments/115527118"},"html":{"href":"https://github.com/CERNDocumentServer/cds/pull/803#discussion_r115527118"},"pull_request":{"href":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/803"}}},"pull_request":{"url":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/803","id":119681266,"html_url":"https://github.com/CERNDocumentServer/cds/pull/803","diff_url":"https://github.com/CERNDocumentServer/cds/pull/803.diff","patch_url":"https://github.com/CERNDocumentServer/cds/pull/803.patch","issue_url":"https://api.github.com/repos/CERNDocumentServer/cds/issues/803","number":803,"state":"open","locked":false,"title":"records: project links inside video serialization","user":{"login":"hachreak","id":377047,"avatar_url":"https://avatars1.githubusercontent.com/u/377047?v=3","gravatar_id":"","url":"https://api.github.com/users/hachreak","html_url":"https://github.com/hachreak","followers_url":"https://api.github.com/users/hachreak/followers","following_url":"https://api.github.com/users/hachreak/following{/other_user}","gists_url":"https://api.github.com/users/hachreak/gists{/gist_id}","starred_url":"https://api.github.com/users/hachreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachreak/subscriptions","organizations_url":"https://api.github.com/users/hachreak/orgs","repos_url":"https://api.github.com/users/hachreak/repos","events_url":"https://api.github.com/users/hachreak/events{/privacy}","received_events_url":"https://api.github.com/users/hachreak/received_events","type":"User","site_admin":false},"body":"* Adds project links inside video serialization. (addresses #739)\r\n\r\nSigned-off-by: Leonardo Rossi <leonardo.r@cern.ch>","created_at":"2017-05-09T15:04:29Z","updated_at":"2017-05-09T15:51:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5860afb889b57c75eadaea6b75b41c5d9576d025","assignee":{"login":"hachreak","id":377047,"avatar_url":"https://avatars1.githubusercontent.com/u/377047?v=3","gravatar_id":"","url":"https://api.github.com/users/hachreak","html_url":"https://github.com/hachreak","followers_url":"https://api.github.com/users/hachreak/followers","following_url":"https://api.github.com/users/hachreak/following{/other_user}","gists_url":"https://api.github.com/users/hachreak/gists{/gist_id}","starred_url":"https://api.github.com/users/hachreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachreak/subscriptions","organizations_url":"https://api.github.com/users/hachreak/orgs","repos_url":"https://api.github.com/users/hachreak/repos","events_url":"https://api.github.com/users/hachreak/events{/privacy}","received_events_url":"https://api.github.com/users/hachreak/received_events","type":"User","site_admin":false},"assignees":[{"login":"hachreak","id":377047,"avatar_url":"https://avatars1.githubusercontent.com/u/377047?v=3","gravatar_id":"","url":"https://api.github.com/users/hachreak","html_url":"https://github.com/hachreak","followers_url":"https://api.github.com/users/hachreak/followers","following_url":"https://api.github.com/users/hachreak/following{/other_user}","gists_url":"https://api.github.com/users/hachreak/gists{/gist_id}","starred_url":"https://api.github.com/users/hachreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachreak/subscriptions","organizations_url":"https://api.github.com/users/hachreak/orgs","repos_url":"https://api.github.com/users/hachreak/repos","events_url":"https://api.github.com/users/hachreak/events{/privacy}","received_events_url":"https://api.github.com/users/hachreak/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/803/commits","review_comments_url":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/803/comments","review_comment_url":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CERNDocumentServer/cds/issues/803/comments","statuses_url":"https://api.github.com/repos/CERNDocumentServer/cds/statuses/2e1494b05270a027d6cbc7f92d01b09645051aee","head":{"label":"hachreak:739_project_link_inside_video","ref":"739_project_link_inside_video","sha":"2e1494b05270a027d6cbc7f92d01b09645051aee","user":{"login":"hachreak","id":377047,"avatar_url":"https://avatars1.githubusercontent.com/u/377047?v=3","gravatar_id":"","url":"https://api.github.com/users/hachreak","html_url":"https://github.com/hachreak","followers_url":"https://api.github.com/users/hachreak/followers","following_url":"https://api.github.com/users/hachreak/following{/other_user}","gists_url":"https://api.github.com/users/hachreak/gists{/gist_id}","starred_url":"https://api.github.com/users/hachreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachreak/subscriptions","organizations_url":"https://api.github.com/users/hachreak/orgs","repos_url":"https://api.github.com/users/hachreak/repos","events_url":"https://api.github.com/users/hachreak/events{/privacy}","received_events_url":"https://api.github.com/users/hachreak/received_events","type":"User","site_admin":false},"repo":{"id":45474407,"name":"cds","full_name":"hachreak/cds","owner":{"login":"hachreak","id":377047,"avatar_url":"https://avatars1.githubusercontent.com/u/377047?v=3","gravatar_id":"","url":"https://api.github.com/users/hachreak","html_url":"https://github.com/hachreak","followers_url":"https://api.github.com/users/hachreak/followers","following_url":"https://api.github.com/users/hachreak/following{/other_user}","gists_url":"https://api.github.com/users/hachreak/gists{/gist_id}","starred_url":"https://api.github.com/users/hachreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachreak/subscriptions","organizations_url":"https://api.github.com/users/hachreak/orgs","repos_url":"https://api.github.com/users/hachreak/repos","events_url":"https://api.github.com/users/hachreak/events{/privacy}","received_events_url":"https://api.github.com/users/hachreak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hachreak/cds","description":"Access articles, reports and multimedia content in HEP","fork":true,"url":"https://api.github.com/repos/hachreak/cds","forks_url":"https://api.github.com/repos/hachreak/cds/forks","keys_url":"https://api.github.com/repos/hachreak/cds/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hachreak/cds/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hachreak/cds/teams","hooks_url":"https://api.github.com/repos/hachreak/cds/hooks","issue_events_url":"https://api.github.com/repos/hachreak/cds/issues/events{/number}","events_url":"https://api.github.com/repos/hachreak/cds/events","assignees_url":"https://api.github.com/repos/hachreak/cds/assignees{/user}","branches_url":"https://api.github.com/repos/hachreak/cds/branches{/branch}","tags_url":"https://api.github.com/repos/hachreak/cds/tags","blobs_url":"https://api.github.com/repos/hachreak/cds/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hachreak/cds/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hachreak/cds/git/refs{/sha}","trees_url":"https://api.github.com/repos/hachreak/cds/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hachreak/cds/statuses/{sha}","languages_url":"https://api.github.com/repos/hachreak/cds/languages","stargazers_url":"https://api.github.com/repos/hachreak/cds/stargazers","contributors_url":"https://api.github.com/repos/hachreak/cds/contributors","subscribers_url":"https://api.github.com/repos/hachreak/cds/subscribers","subscription_url":"https://api.github.com/repos/hachreak/cds/subscription","commits_url":"https://api.github.com/repos/hachreak/cds/commits{/sha}","git_commits_url":"https://api.github.com/repos/hachreak/cds/git/commits{/sha}","comments_url":"https://api.github.com/repos/hachreak/cds/comments{/number}","issue_comment_url":"https://api.github.com/repos/hachreak/cds/issues/comments{/number}","contents_url":"https://api.github.com/repos/hachreak/cds/contents/{+path}","compare_url":"https://api.github.com/repos/hachreak/cds/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hachreak/cds/merges","archive_url":"https://api.github.com/repos/hachreak/cds/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hachreak/cds/downloads","issues_url":"https://api.github.com/repos/hachreak/cds/issues{/number}","pulls_url":"https://api.github.com/repos/hachreak/cds/pulls{/number}","milestones_url":"https://api.github.com/repos/hachreak/cds/milestones{/number}","notifications_url":"https://api.github.com/repos/hachreak/cds/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hachreak/cds/labels{/name}","releases_url":"https://api.github.com/repos/hachreak/cds/releases{/id}","deployments_url":"https://api.github.com/repos/hachreak/cds/deployments","created_at":"2015-11-03T15:07:35Z","updated_at":"2016-09-28T07:00:29Z","pushed_at":"2017-05-09T15:02:53Z","git_url":"git://github.com/hachreak/cds.git","ssh_url":"git@github.com:hachreak/cds.git","clone_url":"https://github.com/hachreak/cds.git","svn_url":"https://github.com/hachreak/cds","homepage":"http://cds.cern.ch","size":73495,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"cdslabs"}},"base":{"label":"CERNDocumentServer:cdslabs_qa","ref":"cdslabs_qa","sha":"052ae4ee800bd6e374e9ff91d65bf9efea983b8c","user":{"login":"CERNDocumentServer","id":7450686,"avatar_url":"https://avatars1.githubusercontent.com/u/7450686?v=3","gravatar_id":"","url":"https://api.github.com/users/CERNDocumentServer","html_url":"https://github.com/CERNDocumentServer","followers_url":"https://api.github.com/users/CERNDocumentServer/followers","following_url":"https://api.github.com/users/CERNDocumentServer/following{/other_user}","gists_url":"https://api.github.com/users/CERNDocumentServer/gists{/gist_id}","starred_url":"https://api.github.com/users/CERNDocumentServer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CERNDocumentServer/subscriptions","organizations_url":"https://api.github.com/users/CERNDocumentServer/orgs","repos_url":"https://api.github.com/users/CERNDocumentServer/repos","events_url":"https://api.github.com/users/CERNDocumentServer/events{/privacy}","received_events_url":"https://api.github.com/users/CERNDocumentServer/received_events","type":"Organization","site_admin":false},"repo":{"id":19456880,"name":"cds","full_name":"CERNDocumentServer/cds","owner":{"login":"CERNDocumentServer","id":7450686,"avatar_url":"https://avatars1.githubusercontent.com/u/7450686?v=3","gravatar_id":"","url":"https://api.github.com/users/CERNDocumentServer","html_url":"https://github.com/CERNDocumentServer","followers_url":"https://api.github.com/users/CERNDocumentServer/followers","following_url":"https://api.github.com/users/CERNDocumentServer/following{/other_user}","gists_url":"https://api.github.com/users/CERNDocumentServer/gists{/gist_id}","starred_url":"https://api.github.com/users/CERNDocumentServer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CERNDocumentServer/subscriptions","organizations_url":"https://api.github.com/users/CERNDocumentServer/orgs","repos_url":"https://api.github.com/users/CERNDocumentServer/repos","events_url":"https://api.github.com/users/CERNDocumentServer/events{/privacy}","received_events_url":"https://api.github.com/users/CERNDocumentServer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CERNDocumentServer/cds","description":"Access articles, reports and multimedia content in HEP","fork":false,"url":"https://api.github.com/repos/CERNDocumentServer/cds","forks_url":"https://api.github.com/repos/CERNDocumentServer/cds/forks","keys_url":"https://api.github.com/repos/CERNDocumentServer/cds/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CERNDocumentServer/cds/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CERNDocumentServer/cds/teams","hooks_url":"https://api.github.com/repos/CERNDocumentServer/cds/hooks","issue_events_url":"https://api.github.com/repos/CERNDocumentServer/cds/issues/events{/number}","events_url":"https://api.github.com/repos/CERNDocumentServer/cds/events","assignees_url":"https://api.github.com/repos/CERNDocumentServer/cds/assignees{/user}","branches_url":"https://api.github.com/repos/CERNDocumentServer/cds/branches{/branch}","tags_url":"https://api.github.com/repos/CERNDocumentServer/cds/tags","blobs_url":"https://api.github.com/repos/CERNDocumentServer/cds/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CERNDocumentServer/cds/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CERNDocumentServer/cds/git/refs{/sha}","trees_url":"https://api.github.com/repos/CERNDocumentServer/cds/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CERNDocumentServer/cds/statuses/{sha}","languages_url":"https://api.github.com/repos/CERNDocumentServer/cds/languages","stargazers_url":"https://api.github.com/repos/CERNDocumentServer/cds/stargazers","contributors_url":"https://api.github.com/repos/CERNDocumentServer/cds/contributors","subscribers_url":"https://api.github.com/repos/CERNDocumentServer/cds/subscribers","subscription_url":"https://api.github.com/repos/CERNDocumentServer/cds/subscription","commits_url":"https://api.github.com/repos/CERNDocumentServer/cds/commits{/sha}","git_commits_url":"https://api.github.com/repos/CERNDocumentServer/cds/git/commits{/sha}","comments_url":"https://api.github.com/repos/CERNDocumentServer/cds/comments{/number}","issue_comment_url":"https://api.github.com/repos/CERNDocumentServer/cds/issues/comments{/number}","contents_url":"https://api.github.com/repos/CERNDocumentServer/cds/contents/{+path}","compare_url":"https://api.github.com/repos/CERNDocumentServer/cds/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CERNDocumentServer/cds/merges","archive_url":"https://api.github.com/repos/CERNDocumentServer/cds/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CERNDocumentServer/cds/downloads","issues_url":"https://api.github.com/repos/CERNDocumentServer/cds/issues{/number}","pulls_url":"https://api.github.com/repos/CERNDocumentServer/cds/pulls{/number}","milestones_url":"https://api.github.com/repos/CERNDocumentServer/cds/milestones{/number}","notifications_url":"https://api.github.com/repos/CERNDocumentServer/cds/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CERNDocumentServer/cds/labels{/name}","releases_url":"https://api.github.com/repos/CERNDocumentServer/cds/releases{/id}","deployments_url":"https://api.github.com/repos/CERNDocumentServer/cds/deployments","created_at":"2014-05-05T13:36:39Z","updated_at":"2017-05-04T19:24:30Z","pushed_at":"2017-05-09T15:29:40Z","git_url":"git://github.com/CERNDocumentServer/cds.git","ssh_url":"git@github.com:CERNDocumentServer/cds.git","clone_url":"https://github.com/CERNDocumentServer/cds.git","svn_url":"https://github.com/CERNDocumentServer/cds","homepage":"http://cds.cern.ch","size":73471,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":88,"forks":17,"open_issues":88,"watchers":1,"default_branch":"cdslabs_qa"}},"_links":{"self":{"href":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/803"},"html":{"href":"https://github.com/CERNDocumentServer/cds/pull/803"},"issue":{"href":"https://api.github.com/repos/CERNDocumentServer/cds/issues/803"},"comments":{"href":"https://api.github.com/repos/CERNDocumentServer/cds/issues/803/comments"},"review_comments":{"href":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/803/comments"},"review_comment":{"href":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CERNDocumentServer/cds/pulls/803/commits"},"statuses":{"href":"https://api.github.com/repos/CERNDocumentServer/cds/statuses/2e1494b05270a027d6cbc7f92d01b09645051aee"}}}}
{"actor":{"display_login":"drjova"}}