{"action":"created","comment":{"url":"https://api.github.com/repos/trevordixon/LilyBin/pulls/comments/29996494","id":29996494,"diff_hunk":"@@ -3,13 +3,30 @@ const levelup = require('level');\n const db = Promise.promisifyAll(levelup('./data'));\n \n exports.scores = {\n-\tget: function(id) {\n-\t\treturn db.getAsync(id)\n+\tget: function(id, rev) {\n+\t\treturn db.getAsync(id + ':' + rev)\n \t\t\t.then(JSON.parse)\n \t},\n+\trevisions: function(id) {\n+\t\treturn db.getAsync(id + ':revisions')\n+\t\t\t.then(null, function (err) {","path":"lib/db.js","position":12,"original_position":12,"commit_id":"61b7ce4d841a2a23333c480496d767039c4c642b","original_commit_id":"61b7ce4d841a2a23333c480496d767039c4c642b","user":{"login":"trevordixon","id":1253245,"avatar_url":"https://avatars.githubusercontent.com/u/1253245?v=3","gravatar_id":"","url":"https://api.github.com/users/trevordixon","html_url":"https://github.com/trevordixon","followers_url":"https://api.github.com/users/trevordixon/followers","following_url":"https://api.github.com/users/trevordixon/following{/other_user}","gists_url":"https://api.github.com/users/trevordixon/gists{/gist_id}","starred_url":"https://api.github.com/users/trevordixon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevordixon/subscriptions","organizations_url":"https://api.github.com/users/trevordixon/orgs","repos_url":"https://api.github.com/users/trevordixon/repos","events_url":"https://api.github.com/users/trevordixon/events{/privacy}","received_events_url":"https://api.github.com/users/trevordixon/received_events","type":"User","site_admin":false},"body":"`.then(function(r) { return parseInt(r, 10); }, ...`\r\n\r\nBetter yet, tell LevelUP to treat everything as JSON. https://github.com/Level/levelup#json-data","created_at":"2015-05-09T21:33:33Z","updated_at":"2015-05-09T21:33:33Z","html_url":"https://github.com/trevordixon/LilyBin/pull/29#discussion_r29996494","pull_request_url":"https://api.github.com/repos/trevordixon/LilyBin/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/trevordixon/LilyBin/pulls/comments/29996494"},"html":{"href":"https://github.com/trevordixon/LilyBin/pull/29#discussion_r29996494"},"pull_request":{"href":"https://api.github.com/repos/trevordixon/LilyBin/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/trevordixon/LilyBin/pulls/29","id":35060712,"html_url":"https://github.com/trevordixon/LilyBin/pull/29","diff_url":"https://github.com/trevordixon/LilyBin/pull/29.diff","patch_url":"https://github.com/trevordixon/LilyBin/pull/29.patch","issue_url":"https://api.github.com/repos/trevordixon/LilyBin/issues/29","number":29,"state":"open","locked":false,"title":"Rewrite DB routines","user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"body":"- Add <samp>db.scores.revisions</samp>\r\n- Fixes bug where when saving from <samp>/:id/1</samp>, <samp>/:id/2</samp> is overwritten regardless\r\n  whether it exists or not.","created_at":"2015-05-09T03:28:16Z","updated_at":"2015-05-09T21:33:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dddc049df7ff92f55e16a7446c44eccaba722590","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/trevordixon/LilyBin/pulls/29/commits","review_comments_url":"https://api.github.com/repos/trevordixon/LilyBin/pulls/29/comments","review_comment_url":"https://api.github.com/repos/trevordixon/LilyBin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trevordixon/LilyBin/issues/29/comments","statuses_url":"https://api.github.com/repos/trevordixon/LilyBin/statuses/61b7ce4d841a2a23333c480496d767039c4c642b","head":{"label":"TimothyGu:a","ref":"a","sha":"61b7ce4d841a2a23333c480496d767039c4c642b","user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"repo":{"id":35007373,"name":"LilyBin","full_name":"TimothyGu/LilyBin","owner":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TimothyGu/LilyBin","description":"Web-based LilyPond editor.","fork":true,"url":"https://api.github.com/repos/TimothyGu/LilyBin","forks_url":"https://api.github.com/repos/TimothyGu/LilyBin/forks","keys_url":"https://api.github.com/repos/TimothyGu/LilyBin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TimothyGu/LilyBin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TimothyGu/LilyBin/teams","hooks_url":"https://api.github.com/repos/TimothyGu/LilyBin/hooks","issue_events_url":"https://api.github.com/repos/TimothyGu/LilyBin/issues/events{/number}","events_url":"https://api.github.com/repos/TimothyGu/LilyBin/events","assignees_url":"https://api.github.com/repos/TimothyGu/LilyBin/assignees{/user}","branches_url":"https://api.github.com/repos/TimothyGu/LilyBin/branches{/branch}","tags_url":"https://api.github.com/repos/TimothyGu/LilyBin/tags","blobs_url":"https://api.github.com/repos/TimothyGu/LilyBin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TimothyGu/LilyBin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TimothyGu/LilyBin/git/refs{/sha}","trees_url":"https://api.github.com/repos/TimothyGu/LilyBin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TimothyGu/LilyBin/statuses/{sha}","languages_url":"https://api.github.com/repos/TimothyGu/LilyBin/languages","stargazers_url":"https://api.github.com/repos/TimothyGu/LilyBin/stargazers","contributors_url":"https://api.github.com/repos/TimothyGu/LilyBin/contributors","subscribers_url":"https://api.github.com/repos/TimothyGu/LilyBin/subscribers","subscription_url":"https://api.github.com/repos/TimothyGu/LilyBin/subscription","commits_url":"https://api.github.com/repos/TimothyGu/LilyBin/commits{/sha}","git_commits_url":"https://api.github.com/repos/TimothyGu/LilyBin/git/commits{/sha}","comments_url":"https://api.github.com/repos/TimothyGu/LilyBin/comments{/number}","issue_comment_url":"https://api.github.com/repos/TimothyGu/LilyBin/issues/comments{/number}","contents_url":"https://api.github.com/repos/TimothyGu/LilyBin/contents/{+path}","compare_url":"https://api.github.com/repos/TimothyGu/LilyBin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TimothyGu/LilyBin/merges","archive_url":"https://api.github.com/repos/TimothyGu/LilyBin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TimothyGu/LilyBin/downloads","issues_url":"https://api.github.com/repos/TimothyGu/LilyBin/issues{/number}","pulls_url":"https://api.github.com/repos/TimothyGu/LilyBin/pulls{/number}","milestones_url":"https://api.github.com/repos/TimothyGu/LilyBin/milestones{/number}","notifications_url":"https://api.github.com/repos/TimothyGu/LilyBin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TimothyGu/LilyBin/labels{/name}","releases_url":"https://api.github.com/repos/TimothyGu/LilyBin/releases{/id}","created_at":"2015-05-04T01:16:13Z","updated_at":"2015-05-07T20:07:03Z","pushed_at":"2015-05-09T18:25:54Z","git_url":"git://github.com/TimothyGu/LilyBin.git","ssh_url":"git@github.com:TimothyGu/LilyBin.git","clone_url":"https://github.com/TimothyGu/LilyBin.git","svn_url":"https://github.com/TimothyGu/LilyBin","homepage":"http://lilybin.com","size":2059,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"trevordixon:master","ref":"master","sha":"9e83423cf610d444e3c3fc5a965c40ae98b6f62a","user":{"login":"trevordixon","id":1253245,"avatar_url":"https://avatars.githubusercontent.com/u/1253245?v=3","gravatar_id":"","url":"https://api.github.com/users/trevordixon","html_url":"https://github.com/trevordixon","followers_url":"https://api.github.com/users/trevordixon/followers","following_url":"https://api.github.com/users/trevordixon/following{/other_user}","gists_url":"https://api.github.com/users/trevordixon/gists{/gist_id}","starred_url":"https://api.github.com/users/trevordixon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevordixon/subscriptions","organizations_url":"https://api.github.com/users/trevordixon/orgs","repos_url":"https://api.github.com/users/trevordixon/repos","events_url":"https://api.github.com/users/trevordixon/events{/privacy}","received_events_url":"https://api.github.com/users/trevordixon/received_events","type":"User","site_admin":false},"repo":{"id":10328994,"name":"LilyBin","full_name":"trevordixon/LilyBin","owner":{"login":"trevordixon","id":1253245,"avatar_url":"https://avatars.githubusercontent.com/u/1253245?v=3","gravatar_id":"","url":"https://api.github.com/users/trevordixon","html_url":"https://github.com/trevordixon","followers_url":"https://api.github.com/users/trevordixon/followers","following_url":"https://api.github.com/users/trevordixon/following{/other_user}","gists_url":"https://api.github.com/users/trevordixon/gists{/gist_id}","starred_url":"https://api.github.com/users/trevordixon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevordixon/subscriptions","organizations_url":"https://api.github.com/users/trevordixon/orgs","repos_url":"https://api.github.com/users/trevordixon/repos","events_url":"https://api.github.com/users/trevordixon/events{/privacy}","received_events_url":"https://api.github.com/users/trevordixon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trevordixon/LilyBin","description":"Web-based LilyPond editor.","fork":false,"url":"https://api.github.com/repos/trevordixon/LilyBin","forks_url":"https://api.github.com/repos/trevordixon/LilyBin/forks","keys_url":"https://api.github.com/repos/trevordixon/LilyBin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trevordixon/LilyBin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trevordixon/LilyBin/teams","hooks_url":"https://api.github.com/repos/trevordixon/LilyBin/hooks","issue_events_url":"https://api.github.com/repos/trevordixon/LilyBin/issues/events{/number}","events_url":"https://api.github.com/repos/trevordixon/LilyBin/events","assignees_url":"https://api.github.com/repos/trevordixon/LilyBin/assignees{/user}","branches_url":"https://api.github.com/repos/trevordixon/LilyBin/branches{/branch}","tags_url":"https://api.github.com/repos/trevordixon/LilyBin/tags","blobs_url":"https://api.github.com/repos/trevordixon/LilyBin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trevordixon/LilyBin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trevordixon/LilyBin/git/refs{/sha}","trees_url":"https://api.github.com/repos/trevordixon/LilyBin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trevordixon/LilyBin/statuses/{sha}","languages_url":"https://api.github.com/repos/trevordixon/LilyBin/languages","stargazers_url":"https://api.github.com/repos/trevordixon/LilyBin/stargazers","contributors_url":"https://api.github.com/repos/trevordixon/LilyBin/contributors","subscribers_url":"https://api.github.com/repos/trevordixon/LilyBin/subscribers","subscription_url":"https://api.github.com/repos/trevordixon/LilyBin/subscription","commits_url":"https://api.github.com/repos/trevordixon/LilyBin/commits{/sha}","git_commits_url":"https://api.github.com/repos/trevordixon/LilyBin/git/commits{/sha}","comments_url":"https://api.github.com/repos/trevordixon/LilyBin/comments{/number}","issue_comment_url":"https://api.github.com/repos/trevordixon/LilyBin/issues/comments{/number}","contents_url":"https://api.github.com/repos/trevordixon/LilyBin/contents/{+path}","compare_url":"https://api.github.com/repos/trevordixon/LilyBin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trevordixon/LilyBin/merges","archive_url":"https://api.github.com/repos/trevordixon/LilyBin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trevordixon/LilyBin/downloads","issues_url":"https://api.github.com/repos/trevordixon/LilyBin/issues{/number}","pulls_url":"https://api.github.com/repos/trevordixon/LilyBin/pulls{/number}","milestones_url":"https://api.github.com/repos/trevordixon/LilyBin/milestones{/number}","notifications_url":"https://api.github.com/repos/trevordixon/LilyBin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trevordixon/LilyBin/labels{/name}","releases_url":"https://api.github.com/repos/trevordixon/LilyBin/releases{/id}","created_at":"2013-05-28T06:15:02Z","updated_at":"2015-05-08T20:44:47Z","pushed_at":"2015-05-09T19:27:15Z","git_url":"git://github.com/trevordixon/LilyBin.git","ssh_url":"git@github.com:trevordixon/LilyBin.git","clone_url":"https://github.com/trevordixon/LilyBin.git","svn_url":"https://github.com/trevordixon/LilyBin","homepage":"http://lilybin.com","size":2185,"stargazers_count":15,"watchers_count":15,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":7,"forks":4,"open_issues":7,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trevordixon/LilyBin/pulls/29"},"html":{"href":"https://github.com/trevordixon/LilyBin/pull/29"},"issue":{"href":"https://api.github.com/repos/trevordixon/LilyBin/issues/29"},"comments":{"href":"https://api.github.com/repos/trevordixon/LilyBin/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/trevordixon/LilyBin/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/trevordixon/LilyBin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trevordixon/LilyBin/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/trevordixon/LilyBin/statuses/61b7ce4d841a2a23333c480496d767039c4c642b"}}}}