{"action":"created","comment":{"url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/comments/61248871","id":61248871,"diff_hunk":"@@ -1093,6 +1068,43 @@ def _key(classification):\n                 edition.sort_author = primary_author.sort_name\n                 edition.display_author = primary_author.display_name\n \n+        # obtains a presentation_edition for the title, which will later be used to get a mirror link.\n+        for link in self.links:\n+            link_obj = link_objects[link]\n+            # TODO: We do not properly handle the (unlikely) case\n+            # where there is an IMAGE_THUMBNAIL link but no IMAGE\n+            # link. In such a case we should treat the IMAGE_THUMBNAIL\n+            # link as though it were an IMAGE link.\n+            if replace.mirror:\n+                # We need to mirror this resource. If it's an image, a\n+                # thumbnail may be provided as a side effect.\n+                self.mirror_link(pool, data_source, link, link_obj, replace)\n+            elif link.thumbnail:\n+                # We don't need to mirror this image, but we do need\n+                # to make sure that its thumbnail exists locally and\n+                # is associated with the original image.\n+                self.make_thumbnail(pool, data_source, link, link_obj)\n+\n+        # follows up on the mirror link, and confirms the delivery mechanism.\n+        for format in self.formats:\n+            if format.link:\n+                link = format.link\n+                if not format.content_type:\n+                    format.content_type = link.media_type\n+                # TODO: I think it's always true that this link","path":"metadata_layer.py","position":100,"original_position":100,"commit_id":"adb77f9a8821f01bf4bf1270b7cb648986f42654","original_commit_id":"adb77f9a8821f01bf4bf1270b7cb648986f42654","user":{"login":"leonardr","id":662474,"avatar_url":"https://avatars.githubusercontent.com/u/662474?v=3","gravatar_id":"","url":"https://api.github.com/users/leonardr","html_url":"https://github.com/leonardr","followers_url":"https://api.github.com/users/leonardr/followers","following_url":"https://api.github.com/users/leonardr/following{/other_user}","gists_url":"https://api.github.com/users/leonardr/gists{/gist_id}","starred_url":"https://api.github.com/users/leonardr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonardr/subscriptions","organizations_url":"https://api.github.com/users/leonardr/orgs","repos_url":"https://api.github.com/users/leonardr/repos","events_url":"https://api.github.com/users/leonardr/events{/privacy}","received_events_url":"https://api.github.com/users/leonardr/received_events","type":"User","site_admin":false},"body":"Now that we do keep track of the link objects you can remove this comment.","created_at":"2016-04-27T12:33:36Z","updated_at":"2016-04-27T12:33:36Z","html_url":"https://github.com/NYPL-Simplified/server_core/pull/192#discussion_r61248871","pull_request_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/192","_links":{"self":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/comments/61248871"},"html":{"href":"https://github.com/NYPL-Simplified/server_core/pull/192#discussion_r61248871"},"pull_request":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/192"}}},"pull_request":{"url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/192","id":67398604,"html_url":"https://github.com/NYPL-Simplified/server_core/pull/192","diff_url":"https://github.com/NYPL-Simplified/server_core/pull/192.diff","patch_url":"https://github.com/NYPL-Simplified/server_core/pull/192.patch","issue_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/192","number":192,"state":"open","locked":false,"title":"Fixed test_calculate_work_for_licensepool_creates_new_work.","user":{"login":"daryanypl","id":18293410,"avatar_url":"https://avatars.githubusercontent.com/u/18293410?v=3","gravatar_id":"","url":"https://api.github.com/users/daryanypl","html_url":"https://github.com/daryanypl","followers_url":"https://api.github.com/users/daryanypl/followers","following_url":"https://api.github.com/users/daryanypl/following{/other_user}","gists_url":"https://api.github.com/users/daryanypl/gists{/gist_id}","starred_url":"https://api.github.com/users/daryanypl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daryanypl/subscriptions","organizations_url":"https://api.github.com/users/daryanypl/orgs","repos_url":"https://api.github.com/users/daryanypl/repos","events_url":"https://api.github.com/users/daryanypl/events{/privacy}","received_events_url":"https://api.github.com/users/daryanypl/received_events","type":"User","site_admin":false},"body":"All tests/test_model.py:TestWorkConsolidation are now passing.","created_at":"2016-04-21T18:15:41Z","updated_at":"2016-04-27T12:33:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"42a13c9b558acd2287d8e082b6c1bf377ce17e6c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/192/commits","review_comments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/192/comments","review_comment_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/192/comments","statuses_url":"https://api.github.com/repos/NYPL-Simplified/server_core/statuses/adb77f9a8821f01bf4bf1270b7cb648986f42654","head":{"label":"NYPL-Simplified:fix-tests-with-composite","ref":"fix-tests-with-composite","sha":"adb77f9a8821f01bf4bf1270b7cb648986f42654","user":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"repo":{"id":27601287,"name":"server_core","full_name":"NYPL-Simplified/server_core","owner":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NYPL-Simplified/server_core","description":"Shared data model and utilities for Library Simplified server applications","fork":false,"url":"https://api.github.com/repos/NYPL-Simplified/server_core","forks_url":"https://api.github.com/repos/NYPL-Simplified/server_core/forks","keys_url":"https://api.github.com/repos/NYPL-Simplified/server_core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NYPL-Simplified/server_core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NYPL-Simplified/server_core/teams","hooks_url":"https://api.github.com/repos/NYPL-Simplified/server_core/hooks","issue_events_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/events{/number}","events_url":"https://api.github.com/repos/NYPL-Simplified/server_core/events","assignees_url":"https://api.github.com/repos/NYPL-Simplified/server_core/assignees{/user}","branches_url":"https://api.github.com/repos/NYPL-Simplified/server_core/branches{/branch}","tags_url":"https://api.github.com/repos/NYPL-Simplified/server_core/tags","blobs_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/refs{/sha}","trees_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NYPL-Simplified/server_core/statuses/{sha}","languages_url":"https://api.github.com/repos/NYPL-Simplified/server_core/languages","stargazers_url":"https://api.github.com/repos/NYPL-Simplified/server_core/stargazers","contributors_url":"https://api.github.com/repos/NYPL-Simplified/server_core/contributors","subscribers_url":"https://api.github.com/repos/NYPL-Simplified/server_core/subscribers","subscription_url":"https://api.github.com/repos/NYPL-Simplified/server_core/subscription","commits_url":"https://api.github.com/repos/NYPL-Simplified/server_core/commits{/sha}","git_commits_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/commits{/sha}","comments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/comments{/number}","issue_comment_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/comments{/number}","contents_url":"https://api.github.com/repos/NYPL-Simplified/server_core/contents/{+path}","compare_url":"https://api.github.com/repos/NYPL-Simplified/server_core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NYPL-Simplified/server_core/merges","archive_url":"https://api.github.com/repos/NYPL-Simplified/server_core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NYPL-Simplified/server_core/downloads","issues_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues{/number}","pulls_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls{/number}","milestones_url":"https://api.github.com/repos/NYPL-Simplified/server_core/milestones{/number}","notifications_url":"https://api.github.com/repos/NYPL-Simplified/server_core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NYPL-Simplified/server_core/labels{/name}","releases_url":"https://api.github.com/repos/NYPL-Simplified/server_core/releases{/id}","deployments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/deployments","created_at":"2014-12-05T17:03:04Z","updated_at":"2016-01-25T15:38:10Z","pushed_at":"2016-04-26T21:40:28Z","git_url":"git://github.com/NYPL-Simplified/server_core.git","ssh_url":"git@github.com:NYPL-Simplified/server_core.git","clone_url":"https://github.com/NYPL-Simplified/server_core.git","svn_url":"https://github.com/NYPL-Simplified/server_core","homepage":null,"size":4423,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":29,"forks":0,"open_issues":29,"watchers":0,"default_branch":"master"}},"base":{"label":"NYPL-Simplified:licensepool-superceded","ref":"licensepool-superceded","sha":"c0a11816df108b81028067f5a9c5c3d67778a5b1","user":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"repo":{"id":27601287,"name":"server_core","full_name":"NYPL-Simplified/server_core","owner":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NYPL-Simplified/server_core","description":"Shared data model and utilities for Library Simplified server applications","fork":false,"url":"https://api.github.com/repos/NYPL-Simplified/server_core","forks_url":"https://api.github.com/repos/NYPL-Simplified/server_core/forks","keys_url":"https://api.github.com/repos/NYPL-Simplified/server_core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NYPL-Simplified/server_core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NYPL-Simplified/server_core/teams","hooks_url":"https://api.github.com/repos/NYPL-Simplified/server_core/hooks","issue_events_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/events{/number}","events_url":"https://api.github.com/repos/NYPL-Simplified/server_core/events","assignees_url":"https://api.github.com/repos/NYPL-Simplified/server_core/assignees{/user}","branches_url":"https://api.github.com/repos/NYPL-Simplified/server_core/branches{/branch}","tags_url":"https://api.github.com/repos/NYPL-Simplified/server_core/tags","blobs_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/refs{/sha}","trees_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NYPL-Simplified/server_core/statuses/{sha}","languages_url":"https://api.github.com/repos/NYPL-Simplified/server_core/languages","stargazers_url":"https://api.github.com/repos/NYPL-Simplified/server_core/stargazers","contributors_url":"https://api.github.com/repos/NYPL-Simplified/server_core/contributors","subscribers_url":"https://api.github.com/repos/NYPL-Simplified/server_core/subscribers","subscription_url":"https://api.github.com/repos/NYPL-Simplified/server_core/subscription","commits_url":"https://api.github.com/repos/NYPL-Simplified/server_core/commits{/sha}","git_commits_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/commits{/sha}","comments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/comments{/number}","issue_comment_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/comments{/number}","contents_url":"https://api.github.com/repos/NYPL-Simplified/server_core/contents/{+path}","compare_url":"https://api.github.com/repos/NYPL-Simplified/server_core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NYPL-Simplified/server_core/merges","archive_url":"https://api.github.com/repos/NYPL-Simplified/server_core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NYPL-Simplified/server_core/downloads","issues_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues{/number}","pulls_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls{/number}","milestones_url":"https://api.github.com/repos/NYPL-Simplified/server_core/milestones{/number}","notifications_url":"https://api.github.com/repos/NYPL-Simplified/server_core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NYPL-Simplified/server_core/labels{/name}","releases_url":"https://api.github.com/repos/NYPL-Simplified/server_core/releases{/id}","deployments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/deployments","created_at":"2014-12-05T17:03:04Z","updated_at":"2016-01-25T15:38:10Z","pushed_at":"2016-04-26T21:40:28Z","git_url":"git://github.com/NYPL-Simplified/server_core.git","ssh_url":"git@github.com:NYPL-Simplified/server_core.git","clone_url":"https://github.com/NYPL-Simplified/server_core.git","svn_url":"https://github.com/NYPL-Simplified/server_core","homepage":null,"size":4423,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":29,"forks":0,"open_issues":29,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/192"},"html":{"href":"https://github.com/NYPL-Simplified/server_core/pull/192"},"issue":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/192"},"comments":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/192/comments"},"review_comments":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/192/comments"},"review_comment":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/192/commits"},"statuses":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/statuses/adb77f9a8821f01bf4bf1270b7cb648986f42654"}}}}