{"action":"created","comment":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/comments/79765620","id":79765620,"diff_hunk":"@@ -1015,6 +1016,48 @@ func (s *apiSuite) TestFindPriced(c *check.C) {\n \tc.Check(rsp.SuggestedCurrency, check.Equals, \"GBP\")\n }\n \n+func (s *apiSuite) TestFindScreenshotted(c *check.C) {\n+\ts.rsnaps = []*snap.Info{{\n+\t\tType:    snap.TypeApp,\n+\t\tVersion: \"v2\",\n+\t\tScreenshots: []snap.ScreenshotInfo{\n+\t\t\tsnap.ScreenshotInfo{\n+\t\t\t\tURL:    \"http://example.com/screenshot.png\",\n+\t\t\t\tWidth:  800,\n+\t\t\t\tHeight: 1280,\n+\t\t\t},\n+\t\t\tsnap.ScreenshotInfo{\n+\t\t\t\tURL: \"http://example.com/screenshot2.png\",\n+\t\t\t},\n+\t\t},\n+\t\tMustBuy: true,\n+\t\tSideInfo: snap.SideInfo{\n+\t\t\tRealName:  \"test-screenshot\",\n+\t\t\tDeveloper: \"foo\",\n+\t\t},\n+\t}}\n+\n+\treq, err := http.NewRequest(\"GET\", \"/v2/find?q=test-screenshot\", nil)\n+\tc.Assert(err, check.IsNil)\n+\trsp, ok := searchStore(findCmd, req, nil).(*resp)\n+\tc.Assert(ok, check.Equals, true)\n+\n+\tsnaps := snapList(rsp.Result)\n+\tc.Assert(snaps, check.HasLen, 1)\n+\n+\tc.Check(snaps[0][\"name\"], check.Equals, \"test-screenshot\")\n+\tc.Check(snaps[0][\"screenshots\"], check.DeepEquals, []interface{}{\n+\t\tmap[string]interface{}{\n+\t\t\t\"url\":    \"http://example.com/screenshot.png\",\n+\t\t\t\"width\":  800,","path":"daemon/api_test.go","position":45,"original_position":45,"commit_id":"bc367008a827032dcda0d73ea3963c7946e4b416","original_commit_id":"bc367008a827032dcda0d73ea3963c7946e4b416","user":{"login":"mvo5","id":914418,"avatar_url":"https://avatars.githubusercontent.com/u/914418?v=3","gravatar_id":"","url":"https://api.github.com/users/mvo5","html_url":"https://github.com/mvo5","followers_url":"https://api.github.com/users/mvo5/followers","following_url":"https://api.github.com/users/mvo5/following{/other_user}","gists_url":"https://api.github.com/users/mvo5/gists{/gist_id}","starred_url":"https://api.github.com/users/mvo5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvo5/subscriptions","organizations_url":"https://api.github.com/users/mvo5/orgs","repos_url":"https://api.github.com/users/mvo5/repos","events_url":"https://api.github.com/users/mvo5/events{/privacy}","received_events_url":"https://api.github.com/users/mvo5/received_events","type":"User","site_admin":false},"body":"If you use `\"width\": float64(800)` here (and below) it will work. This is a idiosyncrasy of the json package, all json number are float64 internally it seem (from  https://golang.org/pkg/encoding/json/#Unmarshal).","created_at":"2016-09-21T06:11:28Z","updated_at":"2016-09-21T06:11:46Z","html_url":"https://github.com/snapcore/snapd/pull/1953#discussion_r79765620","pull_request_url":"https://api.github.com/repos/snapcore/snapd/pulls/1953","_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments/79765620"},"html":{"href":"https://github.com/snapcore/snapd/pull/1953#discussion_r79765620"},"pull_request":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1953"}}},"pull_request":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/1953","id":86093235,"html_url":"https://github.com/snapcore/snapd/pull/1953","diff_url":"https://github.com/snapcore/snapd/pull/1953.diff","patch_url":"https://github.com/snapcore/snapd/pull/1953.patch","issue_url":"https://api.github.com/repos/snapcore/snapd/issues/1953","number":1953,"state":"open","locked":false,"title":"Pass through screenshots from snap store","user":{"login":"robert-ancell","id":126560,"avatar_url":"https://avatars.githubusercontent.com/u/126560?v=3","gravatar_id":"","url":"https://api.github.com/users/robert-ancell","html_url":"https://github.com/robert-ancell","followers_url":"https://api.github.com/users/robert-ancell/followers","following_url":"https://api.github.com/users/robert-ancell/following{/other_user}","gists_url":"https://api.github.com/users/robert-ancell/gists{/gist_id}","starred_url":"https://api.github.com/users/robert-ancell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robert-ancell/subscriptions","organizations_url":"https://api.github.com/users/robert-ancell/orgs","repos_url":"https://api.github.com/users/robert-ancell/repos","events_url":"https://api.github.com/users/robert-ancell/events{/privacy}","received_events_url":"https://api.github.com/users/robert-ancell/received_events","type":"User","site_admin":false},"body":"This change allows the Snap store screenshots to be passed through to a snapd client [1].\r\n\r\nSome thoughts on the changes:\r\n- Even though the store only provides screenshot URLs I added support for more metadata (e.g. width, height). I've requested the store consider providing this [2].\r\n- I wasn't sure if the screenshots should be in snap.Info or snap.DownloadInfo or snap.SideInfo\r\n- The test is failing, but I can't work out why. It seems like it is succeeding but the check.DeepEquals is not working for some reason. I need a Go expert to tell me what I'm doing wrong...\r\n\r\n```\r\napi_test.go:1058:\r\n    c.Check(snaps[0][\"screenshots\"], check.DeepEquals, []interface{}{\r\n        map[string]interface{}{\r\n            \"url\":    \"http://example.com/screenshot.png\",\r\n            \"width\":  800,\r\n            \"height\": 1280,\r\n        },\r\n        map[string]interface{}{\r\n            \"url\": \"http://example.com/screenshot2.png\",\r\n        },\r\n    })\r\n... obtained []interface {} = []interface {}{map[string]interface {}{\"width\":800, \"height\":1280, \"url\":\"http://example.com/screenshot.png\"}, map[string]interface {}{\"url\":\"http://example.com/screenshot2.png\"}}\r\n... expected []interface {} = []interface {}{map[string]interface {}{\"height\":1280, \"url\":\"http://example.com/screenshot.png\", \"width\":800}, map[string]interface {}{\"url\":\"http://example.com/screenshot2.png\"}}\r\n```\r\n\r\n[1] https://bugs.launchpad.net/bugs/1603610\r\n[2] https://bugs.launchpad.net/bugs/1625852","created_at":"2016-09-21T03:42:44Z","updated_at":"2016-09-21T06:11:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b5604d0d39920b227a06508c19bd7be8a212868","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/snapcore/snapd/pulls/1953/commits","review_comments_url":"https://api.github.com/repos/snapcore/snapd/pulls/1953/comments","review_comment_url":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/snapcore/snapd/issues/1953/comments","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/bc367008a827032dcda0d73ea3963c7946e4b416","head":{"label":"robert-ancell:screenshots","ref":"screenshots","sha":"bc367008a827032dcda0d73ea3963c7946e4b416","user":{"login":"robert-ancell","id":126560,"avatar_url":"https://avatars.githubusercontent.com/u/126560?v=3","gravatar_id":"","url":"https://api.github.com/users/robert-ancell","html_url":"https://github.com/robert-ancell","followers_url":"https://api.github.com/users/robert-ancell/followers","following_url":"https://api.github.com/users/robert-ancell/following{/other_user}","gists_url":"https://api.github.com/users/robert-ancell/gists{/gist_id}","starred_url":"https://api.github.com/users/robert-ancell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robert-ancell/subscriptions","organizations_url":"https://api.github.com/users/robert-ancell/orgs","repos_url":"https://api.github.com/users/robert-ancell/repos","events_url":"https://api.github.com/users/robert-ancell/events{/privacy}","received_events_url":"https://api.github.com/users/robert-ancell/received_events","type":"User","site_admin":false},"repo":{"id":50393200,"name":"snapd","full_name":"robert-ancell/snapd","owner":{"login":"robert-ancell","id":126560,"avatar_url":"https://avatars.githubusercontent.com/u/126560?v=3","gravatar_id":"","url":"https://api.github.com/users/robert-ancell","html_url":"https://github.com/robert-ancell","followers_url":"https://api.github.com/users/robert-ancell/followers","following_url":"https://api.github.com/users/robert-ancell/following{/other_user}","gists_url":"https://api.github.com/users/robert-ancell/gists{/gist_id}","starred_url":"https://api.github.com/users/robert-ancell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robert-ancell/subscriptions","organizations_url":"https://api.github.com/users/robert-ancell/orgs","repos_url":"https://api.github.com/users/robert-ancell/repos","events_url":"https://api.github.com/users/robert-ancell/events{/privacy}","received_events_url":"https://api.github.com/users/robert-ancell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robert-ancell/snapd","description":"Snappy is the software at the heart of Ubuntu Core.","fork":true,"url":"https://api.github.com/repos/robert-ancell/snapd","forks_url":"https://api.github.com/repos/robert-ancell/snapd/forks","keys_url":"https://api.github.com/repos/robert-ancell/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robert-ancell/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robert-ancell/snapd/teams","hooks_url":"https://api.github.com/repos/robert-ancell/snapd/hooks","issue_events_url":"https://api.github.com/repos/robert-ancell/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/robert-ancell/snapd/events","assignees_url":"https://api.github.com/repos/robert-ancell/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/robert-ancell/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/robert-ancell/snapd/tags","blobs_url":"https://api.github.com/repos/robert-ancell/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robert-ancell/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robert-ancell/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/robert-ancell/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robert-ancell/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/robert-ancell/snapd/languages","stargazers_url":"https://api.github.com/repos/robert-ancell/snapd/stargazers","contributors_url":"https://api.github.com/repos/robert-ancell/snapd/contributors","subscribers_url":"https://api.github.com/repos/robert-ancell/snapd/subscribers","subscription_url":"https://api.github.com/repos/robert-ancell/snapd/subscription","commits_url":"https://api.github.com/repos/robert-ancell/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/robert-ancell/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/robert-ancell/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/robert-ancell/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/robert-ancell/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/robert-ancell/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robert-ancell/snapd/merges","archive_url":"https://api.github.com/repos/robert-ancell/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robert-ancell/snapd/downloads","issues_url":"https://api.github.com/repos/robert-ancell/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/robert-ancell/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/robert-ancell/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/robert-ancell/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robert-ancell/snapd/labels{/name}","releases_url":"https://api.github.com/repos/robert-ancell/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/robert-ancell/snapd/deployments","created_at":"2016-01-26T01:14:39Z","updated_at":"2016-08-02T03:27:27Z","pushed_at":"2016-09-21T03:37:27Z","git_url":"git://github.com/robert-ancell/snapd.git","ssh_url":"git@github.com:robert-ancell/snapd.git","clone_url":"https://github.com/robert-ancell/snapd.git","svn_url":"https://github.com/robert-ancell/snapd","homepage":null,"size":35813,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"snapcore:master","ref":"master","sha":"98c8e937625ce3134cf17025d8f0eb3e1016259a","user":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars.githubusercontent.com/u/19532717?v=3","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"repo":{"id":44672744,"name":"snapd","full_name":"snapcore/snapd","owner":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars.githubusercontent.com/u/19532717?v=3","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/snapcore/snapd","description":"The snapd and snap tools enable systems to work with .snap files.","fork":false,"url":"https://api.github.com/repos/snapcore/snapd","forks_url":"https://api.github.com/repos/snapcore/snapd/forks","keys_url":"https://api.github.com/repos/snapcore/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snapcore/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snapcore/snapd/teams","hooks_url":"https://api.github.com/repos/snapcore/snapd/hooks","issue_events_url":"https://api.github.com/repos/snapcore/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/snapcore/snapd/events","assignees_url":"https://api.github.com/repos/snapcore/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/snapcore/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/snapcore/snapd/tags","blobs_url":"https://api.github.com/repos/snapcore/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snapcore/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snapcore/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/snapcore/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/snapcore/snapd/languages","stargazers_url":"https://api.github.com/repos/snapcore/snapd/stargazers","contributors_url":"https://api.github.com/repos/snapcore/snapd/contributors","subscribers_url":"https://api.github.com/repos/snapcore/snapd/subscribers","subscription_url":"https://api.github.com/repos/snapcore/snapd/subscription","commits_url":"https://api.github.com/repos/snapcore/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/snapcore/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/snapcore/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/snapcore/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/snapcore/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/snapcore/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snapcore/snapd/merges","archive_url":"https://api.github.com/repos/snapcore/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snapcore/snapd/downloads","issues_url":"https://api.github.com/repos/snapcore/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/snapcore/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/snapcore/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/snapcore/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snapcore/snapd/labels{/name}","releases_url":"https://api.github.com/repos/snapcore/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/snapcore/snapd/deployments","created_at":"2015-10-21T11:51:46Z","updated_at":"2016-09-20T12:29:10Z","pushed_at":"2016-09-21T05:55:51Z","git_url":"git://github.com/snapcore/snapd.git","ssh_url":"git@github.com:snapcore/snapd.git","clone_url":"https://github.com/snapcore/snapd.git","svn_url":"https://github.com/snapcore/snapd","homepage":"","size":38272,"stargazers_count":396,"watchers_count":396,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":105,"mirror_url":null,"open_issues_count":25,"forks":105,"open_issues":25,"watchers":396,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1953"},"html":{"href":"https://github.com/snapcore/snapd/pull/1953"},"issue":{"href":"https://api.github.com/repos/snapcore/snapd/issues/1953"},"comments":{"href":"https://api.github.com/repos/snapcore/snapd/issues/1953/comments"},"review_comments":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1953/comments"},"review_comment":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1953/commits"},"statuses":{"href":"https://api.github.com/repos/snapcore/snapd/statuses/bc367008a827032dcda0d73ea3963c7946e4b416"}}}}
{"actor":{"display_login":"mvo5"}}