{"action":"created","comment":{"url":"https://api.github.com/repos/feross/webtorrent-app/pulls/comments/55135557","id":55135557,"diff_hunk":"@@ -251,6 +251,35 @@ function addTorrentEvents (torrent) {\n   }\n }\n \n+function restoreSession () {\n+  cfg.read(function (err, data) {\n+    if (err) console.error(err)\n+    state.saved = data\n+    if (!state.saved.torrents) state.saved.torrents = []","path":"renderer/index.js","position":37,"original_position":37,"commit_id":"96340d3255e6a6221404b8b3458bfaaadb40f3db","original_commit_id":"96340d3255e6a6221404b8b3458bfaaadb40f3db","user":{"login":"ngoldman","id":427322,"avatar_url":"https://avatars.githubusercontent.com/u/427322?v=3","gravatar_id":"","url":"https://api.github.com/users/ngoldman","html_url":"https://github.com/ngoldman","followers_url":"https://api.github.com/users/ngoldman/followers","following_url":"https://api.github.com/users/ngoldman/following{/other_user}","gists_url":"https://api.github.com/users/ngoldman/gists{/gist_id}","starred_url":"https://api.github.com/users/ngoldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngoldman/subscriptions","organizations_url":"https://api.github.com/users/ngoldman/orgs","repos_url":"https://api.github.com/users/ngoldman/repos","events_url":"https://api.github.com/users/ngoldman/events{/privacy}","received_events_url":"https://api.github.com/users/ngoldman/received_events","type":"User","site_admin":false},"body":"Truth.","created_at":"2016-03-06T09:11:20Z","updated_at":"2016-03-06T09:11:20Z","html_url":"https://github.com/feross/webtorrent-app/pull/46#discussion_r55135557","pull_request_url":"https://api.github.com/repos/feross/webtorrent-app/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/feross/webtorrent-app/pulls/comments/55135557"},"html":{"href":"https://github.com/feross/webtorrent-app/pull/46#discussion_r55135557"},"pull_request":{"href":"https://api.github.com/repos/feross/webtorrent-app/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/feross/webtorrent-app/pulls/46","id":61835409,"html_url":"https://github.com/feross/webtorrent-app/pull/46","diff_url":"https://github.com/feross/webtorrent-app/pull/46.diff","patch_url":"https://github.com/feross/webtorrent-app/pull/46.patch","issue_url":"https://api.github.com/repos/feross/webtorrent-app/issues/46","number":46,"state":"closed","locked":false,"title":"add persistent app config","user":{"login":"ngoldman","id":427322,"avatar_url":"https://avatars.githubusercontent.com/u/427322?v=3","gravatar_id":"","url":"https://api.github.com/users/ngoldman","html_url":"https://github.com/ngoldman","followers_url":"https://api.github.com/users/ngoldman/followers","following_url":"https://api.github.com/users/ngoldman/following{/other_user}","gists_url":"https://api.github.com/users/ngoldman/gists{/gist_id}","starred_url":"https://api.github.com/users/ngoldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngoldman/subscriptions","organizations_url":"https://api.github.com/users/ngoldman/orgs","repos_url":"https://api.github.com/users/ngoldman/repos","events_url":"https://api.github.com/users/ngoldman/events{/privacy}","received_events_url":"https://api.github.com/users/ngoldman/received_events","type":"User","site_admin":false},"body":"Using `application-config` for now. So far working great. Storing magnet URIs of torrents in config instead of `.torrent` file paths since those are often deleted.\r\n\r\nPlayed around with some different ways to capture and save torrent info until I realized I could just save info from `state.client.map` with the props I wanted on every client `torrent` event. That way no deduping is necessary. The WebTorrent client always tells the truth.\r\n\r\n> resolves #24","created_at":"2016-03-06T06:31:14Z","updated_at":"2016-03-06T09:11:20Z","closed_at":"2016-03-06T07:32:50Z","merged_at":"2016-03-06T07:32:50Z","merge_commit_sha":"50e37f5fb826bfd533150f1d25c9e33ce27d5710","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/feross/webtorrent-app/pulls/46/commits","review_comments_url":"https://api.github.com/repos/feross/webtorrent-app/pulls/46/comments","review_comment_url":"https://api.github.com/repos/feross/webtorrent-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/feross/webtorrent-app/issues/46/comments","statuses_url":"https://api.github.com/repos/feross/webtorrent-app/statuses/96340d3255e6a6221404b8b3458bfaaadb40f3db","head":{"label":"feross:persist","ref":"persist","sha":"96340d3255e6a6221404b8b3458bfaaadb40f3db","user":{"login":"feross","id":121766,"avatar_url":"https://avatars.githubusercontent.com/u/121766?v=3","gravatar_id":"","url":"https://api.github.com/users/feross","html_url":"https://github.com/feross","followers_url":"https://api.github.com/users/feross/followers","following_url":"https://api.github.com/users/feross/following{/other_user}","gists_url":"https://api.github.com/users/feross/gists{/gist_id}","starred_url":"https://api.github.com/users/feross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feross/subscriptions","organizations_url":"https://api.github.com/users/feross/orgs","repos_url":"https://api.github.com/users/feross/repos","events_url":"https://api.github.com/users/feross/events{/privacy}","received_events_url":"https://api.github.com/users/feross/received_events","type":"User","site_admin":false},"repo":{"id":35015575,"name":"webtorrent-app","full_name":"feross/webtorrent-app","owner":{"login":"feross","id":121766,"avatar_url":"https://avatars.githubusercontent.com/u/121766?v=3","gravatar_id":"","url":"https://api.github.com/users/feross","html_url":"https://github.com/feross","followers_url":"https://api.github.com/users/feross/followers","following_url":"https://api.github.com/users/feross/following{/other_user}","gists_url":"https://api.github.com/users/feross/gists{/gist_id}","starred_url":"https://api.github.com/users/feross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feross/subscriptions","organizations_url":"https://api.github.com/users/feross/orgs","repos_url":"https://api.github.com/users/feross/repos","events_url":"https://api.github.com/users/feross/events{/privacy}","received_events_url":"https://api.github.com/users/feross/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/feross/webtorrent-app","description":"WebTorrent, the streaming torrent client. For OS X, Windows, and Linux.","fork":false,"url":"https://api.github.com/repos/feross/webtorrent-app","forks_url":"https://api.github.com/repos/feross/webtorrent-app/forks","keys_url":"https://api.github.com/repos/feross/webtorrent-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feross/webtorrent-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feross/webtorrent-app/teams","hooks_url":"https://api.github.com/repos/feross/webtorrent-app/hooks","issue_events_url":"https://api.github.com/repos/feross/webtorrent-app/issues/events{/number}","events_url":"https://api.github.com/repos/feross/webtorrent-app/events","assignees_url":"https://api.github.com/repos/feross/webtorrent-app/assignees{/user}","branches_url":"https://api.github.com/repos/feross/webtorrent-app/branches{/branch}","tags_url":"https://api.github.com/repos/feross/webtorrent-app/tags","blobs_url":"https://api.github.com/repos/feross/webtorrent-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feross/webtorrent-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feross/webtorrent-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/feross/webtorrent-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feross/webtorrent-app/statuses/{sha}","languages_url":"https://api.github.com/repos/feross/webtorrent-app/languages","stargazers_url":"https://api.github.com/repos/feross/webtorrent-app/stargazers","contributors_url":"https://api.github.com/repos/feross/webtorrent-app/contributors","subscribers_url":"https://api.github.com/repos/feross/webtorrent-app/subscribers","subscription_url":"https://api.github.com/repos/feross/webtorrent-app/subscription","commits_url":"https://api.github.com/repos/feross/webtorrent-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/feross/webtorrent-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/feross/webtorrent-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/feross/webtorrent-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/feross/webtorrent-app/contents/{+path}","compare_url":"https://api.github.com/repos/feross/webtorrent-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feross/webtorrent-app/merges","archive_url":"https://api.github.com/repos/feross/webtorrent-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feross/webtorrent-app/downloads","issues_url":"https://api.github.com/repos/feross/webtorrent-app/issues{/number}","pulls_url":"https://api.github.com/repos/feross/webtorrent-app/pulls{/number}","milestones_url":"https://api.github.com/repos/feross/webtorrent-app/milestones{/number}","notifications_url":"https://api.github.com/repos/feross/webtorrent-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feross/webtorrent-app/labels{/name}","releases_url":"https://api.github.com/repos/feross/webtorrent-app/releases{/id}","deployments_url":"https://api.github.com/repos/feross/webtorrent-app/deployments","created_at":"2015-05-04T05:21:35Z","updated_at":"2016-03-06T08:40:12Z","pushed_at":"2016-03-06T09:03:25Z","git_url":"git://github.com/feross/webtorrent-app.git","ssh_url":"git@github.com:feross/webtorrent-app.git","clone_url":"https://github.com/feross/webtorrent-app.git","svn_url":"https://github.com/feross/webtorrent-app","homepage":"","size":1327,"stargazers_count":70,"watchers_count":70,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":10,"forks":5,"open_issues":10,"watchers":70,"default_branch":"master"}},"base":{"label":"feross:master","ref":"master","sha":"530db50adc7656a6ea52dd4900beb3e5e770a472","user":{"login":"feross","id":121766,"avatar_url":"https://avatars.githubusercontent.com/u/121766?v=3","gravatar_id":"","url":"https://api.github.com/users/feross","html_url":"https://github.com/feross","followers_url":"https://api.github.com/users/feross/followers","following_url":"https://api.github.com/users/feross/following{/other_user}","gists_url":"https://api.github.com/users/feross/gists{/gist_id}","starred_url":"https://api.github.com/users/feross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feross/subscriptions","organizations_url":"https://api.github.com/users/feross/orgs","repos_url":"https://api.github.com/users/feross/repos","events_url":"https://api.github.com/users/feross/events{/privacy}","received_events_url":"https://api.github.com/users/feross/received_events","type":"User","site_admin":false},"repo":{"id":35015575,"name":"webtorrent-app","full_name":"feross/webtorrent-app","owner":{"login":"feross","id":121766,"avatar_url":"https://avatars.githubusercontent.com/u/121766?v=3","gravatar_id":"","url":"https://api.github.com/users/feross","html_url":"https://github.com/feross","followers_url":"https://api.github.com/users/feross/followers","following_url":"https://api.github.com/users/feross/following{/other_user}","gists_url":"https://api.github.com/users/feross/gists{/gist_id}","starred_url":"https://api.github.com/users/feross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feross/subscriptions","organizations_url":"https://api.github.com/users/feross/orgs","repos_url":"https://api.github.com/users/feross/repos","events_url":"https://api.github.com/users/feross/events{/privacy}","received_events_url":"https://api.github.com/users/feross/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/feross/webtorrent-app","description":"WebTorrent, the streaming torrent client. For OS X, Windows, and Linux.","fork":false,"url":"https://api.github.com/repos/feross/webtorrent-app","forks_url":"https://api.github.com/repos/feross/webtorrent-app/forks","keys_url":"https://api.github.com/repos/feross/webtorrent-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feross/webtorrent-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feross/webtorrent-app/teams","hooks_url":"https://api.github.com/repos/feross/webtorrent-app/hooks","issue_events_url":"https://api.github.com/repos/feross/webtorrent-app/issues/events{/number}","events_url":"https://api.github.com/repos/feross/webtorrent-app/events","assignees_url":"https://api.github.com/repos/feross/webtorrent-app/assignees{/user}","branches_url":"https://api.github.com/repos/feross/webtorrent-app/branches{/branch}","tags_url":"https://api.github.com/repos/feross/webtorrent-app/tags","blobs_url":"https://api.github.com/repos/feross/webtorrent-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feross/webtorrent-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feross/webtorrent-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/feross/webtorrent-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feross/webtorrent-app/statuses/{sha}","languages_url":"https://api.github.com/repos/feross/webtorrent-app/languages","stargazers_url":"https://api.github.com/repos/feross/webtorrent-app/stargazers","contributors_url":"https://api.github.com/repos/feross/webtorrent-app/contributors","subscribers_url":"https://api.github.com/repos/feross/webtorrent-app/subscribers","subscription_url":"https://api.github.com/repos/feross/webtorrent-app/subscription","commits_url":"https://api.github.com/repos/feross/webtorrent-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/feross/webtorrent-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/feross/webtorrent-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/feross/webtorrent-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/feross/webtorrent-app/contents/{+path}","compare_url":"https://api.github.com/repos/feross/webtorrent-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feross/webtorrent-app/merges","archive_url":"https://api.github.com/repos/feross/webtorrent-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feross/webtorrent-app/downloads","issues_url":"https://api.github.com/repos/feross/webtorrent-app/issues{/number}","pulls_url":"https://api.github.com/repos/feross/webtorrent-app/pulls{/number}","milestones_url":"https://api.github.com/repos/feross/webtorrent-app/milestones{/number}","notifications_url":"https://api.github.com/repos/feross/webtorrent-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feross/webtorrent-app/labels{/name}","releases_url":"https://api.github.com/repos/feross/webtorrent-app/releases{/id}","deployments_url":"https://api.github.com/repos/feross/webtorrent-app/deployments","created_at":"2015-05-04T05:21:35Z","updated_at":"2016-03-06T08:40:12Z","pushed_at":"2016-03-06T09:03:25Z","git_url":"git://github.com/feross/webtorrent-app.git","ssh_url":"git@github.com:feross/webtorrent-app.git","clone_url":"https://github.com/feross/webtorrent-app.git","svn_url":"https://github.com/feross/webtorrent-app","homepage":"","size":1327,"stargazers_count":70,"watchers_count":70,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":10,"forks":5,"open_issues":10,"watchers":70,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/feross/webtorrent-app/pulls/46"},"html":{"href":"https://github.com/feross/webtorrent-app/pull/46"},"issue":{"href":"https://api.github.com/repos/feross/webtorrent-app/issues/46"},"comments":{"href":"https://api.github.com/repos/feross/webtorrent-app/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/feross/webtorrent-app/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/feross/webtorrent-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/feross/webtorrent-app/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/feross/webtorrent-app/statuses/96340d3255e6a6221404b8b3458bfaaadb40f3db"}}}}