{"action":"created","comment":{"url":"https://api.github.com/repos/Flexget/Flexget/pulls/comments/60496262","id":60496262,"diff_hunk":"@@ -77,16 +79,21 @@ def reset_plugin(options):\n             console('Unable to reset %s: %s' % (plugin, e.message))\n \n \n+def backup(manager):\n+    fire_event('manager.backup_db', manager)","path":"flexget/plugins/cli/database.py","position":23,"original_position":23,"commit_id":"ef7f72f6b8474f90726f988b1e1fd559bdec4740","original_commit_id":"ef7f72f6b8474f90726f988b1e1fd559bdec4740","user":{"login":"liiight","id":4374581,"avatar_url":"https://avatars.githubusercontent.com/u/4374581?v=3","gravatar_id":"","url":"https://api.github.com/users/liiight","html_url":"https://github.com/liiight","followers_url":"https://api.github.com/users/liiight/followers","following_url":"https://api.github.com/users/liiight/following{/other_user}","gists_url":"https://api.github.com/users/liiight/gists{/gist_id}","starred_url":"https://api.github.com/users/liiight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liiight/subscriptions","organizations_url":"https://api.github.com/users/liiight/orgs","repos_url":"https://api.github.com/users/liiight/repos","events_url":"https://api.github.com/users/liiight/events{/privacy}","received_events_url":"https://api.github.com/users/liiight/received_events","type":"User","site_admin":false},"body":"Nm, misread at first. Got it","created_at":"2016-04-20T22:07:12Z","updated_at":"2016-04-20T22:07:12Z","html_url":"https://github.com/Flexget/Flexget/pull/1052#discussion_r60496262","pull_request_url":"https://api.github.com/repos/Flexget/Flexget/pulls/1052","_links":{"self":{"href":"https://api.github.com/repos/Flexget/Flexget/pulls/comments/60496262"},"html":{"href":"https://github.com/Flexget/Flexget/pull/1052#discussion_r60496262"},"pull_request":{"href":"https://api.github.com/repos/Flexget/Flexget/pulls/1052"}}},"pull_request":{"url":"https://api.github.com/repos/Flexget/Flexget/pulls/1052","id":66987427,"html_url":"https://github.com/Flexget/Flexget/pull/1052","diff_url":"https://github.com/Flexget/Flexget/pull/1052.diff","patch_url":"https://github.com/Flexget/Flexget/pull/1052.patch","issue_url":"https://api.github.com/repos/Flexget/Flexget/issues/1052","number":1052,"state":"open","locked":false,"title":"DB backup on upgrade plugin","user":{"login":"liiight","id":4374581,"avatar_url":"https://avatars.githubusercontent.com/u/4374581?v=3","gravatar_id":"","url":"https://api.github.com/users/liiight","html_url":"https://github.com/liiight","followers_url":"https://api.github.com/users/liiight/followers","following_url":"https://api.github.com/users/liiight/following{/other_user}","gists_url":"https://api.github.com/users/liiight/gists{/gist_id}","starred_url":"https://api.github.com/users/liiight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liiight/subscriptions","organizations_url":"https://api.github.com/users/liiight/orgs","repos_url":"https://api.github.com/users/liiight/repos","events_url":"https://api.github.com/users/liiight/events{/privacy}","received_events_url":"https://api.github.com/users/liiight/received_events","type":"User","site_admin":false},"body":"<githubroot>This plugin purpose is to backup DB when DB upgrade is needed in order to avoid DB corruption in case of failed backup.\r<br />\r<br />It is used with the `--backup-db` flag.\r<br />When a DB upgraded is needed it will fire the `manager.backup_db` event which is caught by the plugin.\r<br />\r<br />A local copy of the DB will be created with the format: `backup-<CONFIG_NAME>-<DATE>_<TIME>-<FLEXGET_VERSION>.sqlite`. \r<br />Example: `backup-config2-20160419_1217-1.2.515.dev.sqlite`\r<br />\r<br />When the flag is not present and a DB upgrade is initiated, a log info appears:\r<br /> `DB is upgrading without a backup, consider using the --backup-db-on-upgrade flag`.\r<br />\r<br />In addition, a new CLI command was introduced to manually use this plugin:\r<br />`flexget database backup`.\r<br />\r<br />\r<br /></githubroot>","created_at":"2016-04-19T09:35:13Z","updated_at":"2016-04-20T22:07:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db4089ff1131f503b07f05055919f8b8867956b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Flexget/Flexget/pulls/1052/commits","review_comments_url":"https://api.github.com/repos/Flexget/Flexget/pulls/1052/comments","review_comment_url":"https://api.github.com/repos/Flexget/Flexget/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Flexget/Flexget/issues/1052/comments","statuses_url":"https://api.github.com/repos/Flexget/Flexget/statuses/ef7f72f6b8474f90726f988b1e1fd559bdec4740","head":{"label":"liiight:db_backup","ref":"db_backup","sha":"ef7f72f6b8474f90726f988b1e1fd559bdec4740","user":{"login":"liiight","id":4374581,"avatar_url":"https://avatars.githubusercontent.com/u/4374581?v=3","gravatar_id":"","url":"https://api.github.com/users/liiight","html_url":"https://github.com/liiight","followers_url":"https://api.github.com/users/liiight/followers","following_url":"https://api.github.com/users/liiight/following{/other_user}","gists_url":"https://api.github.com/users/liiight/gists{/gist_id}","starred_url":"https://api.github.com/users/liiight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liiight/subscriptions","organizations_url":"https://api.github.com/users/liiight/orgs","repos_url":"https://api.github.com/users/liiight/repos","events_url":"https://api.github.com/users/liiight/events{/privacy}","received_events_url":"https://api.github.com/users/liiight/received_events","type":"User","site_admin":false},"repo":{"id":37118293,"name":"Flexget","full_name":"liiight/Flexget","owner":{"login":"liiight","id":4374581,"avatar_url":"https://avatars.githubusercontent.com/u/4374581?v=3","gravatar_id":"","url":"https://api.github.com/users/liiight","html_url":"https://github.com/liiight","followers_url":"https://api.github.com/users/liiight/followers","following_url":"https://api.github.com/users/liiight/following{/other_user}","gists_url":"https://api.github.com/users/liiight/gists{/gist_id}","starred_url":"https://api.github.com/users/liiight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liiight/subscriptions","organizations_url":"https://api.github.com/users/liiight/orgs","repos_url":"https://api.github.com/users/liiight/repos","events_url":"https://api.github.com/users/liiight/events{/privacy}","received_events_url":"https://api.github.com/users/liiight/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liiight/Flexget","description":"liight's flexget fork","fork":true,"url":"https://api.github.com/repos/liiight/Flexget","forks_url":"https://api.github.com/repos/liiight/Flexget/forks","keys_url":"https://api.github.com/repos/liiight/Flexget/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liiight/Flexget/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liiight/Flexget/teams","hooks_url":"https://api.github.com/repos/liiight/Flexget/hooks","issue_events_url":"https://api.github.com/repos/liiight/Flexget/issues/events{/number}","events_url":"https://api.github.com/repos/liiight/Flexget/events","assignees_url":"https://api.github.com/repos/liiight/Flexget/assignees{/user}","branches_url":"https://api.github.com/repos/liiight/Flexget/branches{/branch}","tags_url":"https://api.github.com/repos/liiight/Flexget/tags","blobs_url":"https://api.github.com/repos/liiight/Flexget/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liiight/Flexget/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liiight/Flexget/git/refs{/sha}","trees_url":"https://api.github.com/repos/liiight/Flexget/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liiight/Flexget/statuses/{sha}","languages_url":"https://api.github.com/repos/liiight/Flexget/languages","stargazers_url":"https://api.github.com/repos/liiight/Flexget/stargazers","contributors_url":"https://api.github.com/repos/liiight/Flexget/contributors","subscribers_url":"https://api.github.com/repos/liiight/Flexget/subscribers","subscription_url":"https://api.github.com/repos/liiight/Flexget/subscription","commits_url":"https://api.github.com/repos/liiight/Flexget/commits{/sha}","git_commits_url":"https://api.github.com/repos/liiight/Flexget/git/commits{/sha}","comments_url":"https://api.github.com/repos/liiight/Flexget/comments{/number}","issue_comment_url":"https://api.github.com/repos/liiight/Flexget/issues/comments{/number}","contents_url":"https://api.github.com/repos/liiight/Flexget/contents/{+path}","compare_url":"https://api.github.com/repos/liiight/Flexget/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liiight/Flexget/merges","archive_url":"https://api.github.com/repos/liiight/Flexget/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liiight/Flexget/downloads","issues_url":"https://api.github.com/repos/liiight/Flexget/issues{/number}","pulls_url":"https://api.github.com/repos/liiight/Flexget/pulls{/number}","milestones_url":"https://api.github.com/repos/liiight/Flexget/milestones{/number}","notifications_url":"https://api.github.com/repos/liiight/Flexget/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liiight/Flexget/labels{/name}","releases_url":"https://api.github.com/repos/liiight/Flexget/releases{/id}","deployments_url":"https://api.github.com/repos/liiight/Flexget/deployments","created_at":"2015-06-09T07:51:41Z","updated_at":"2016-02-10T21:40:45Z","pushed_at":"2016-04-19T10:54:01Z","git_url":"git://github.com/liiight/Flexget.git","ssh_url":"git@github.com:liiight/Flexget.git","clone_url":"https://github.com/liiight/Flexget.git","svn_url":"https://github.com/liiight/Flexget","homepage":"","size":34601,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"develop"}},"base":{"label":"Flexget:develop","ref":"develop","sha":"e4b149967a51ea543db3e04efc86fa838e56752a","user":{"login":"Flexget","id":682553,"avatar_url":"https://avatars.githubusercontent.com/u/682553?v=3","gravatar_id":"","url":"https://api.github.com/users/Flexget","html_url":"https://github.com/Flexget","followers_url":"https://api.github.com/users/Flexget/followers","following_url":"https://api.github.com/users/Flexget/following{/other_user}","gists_url":"https://api.github.com/users/Flexget/gists{/gist_id}","starred_url":"https://api.github.com/users/Flexget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flexget/subscriptions","organizations_url":"https://api.github.com/users/Flexget/orgs","repos_url":"https://api.github.com/users/Flexget/repos","events_url":"https://api.github.com/users/Flexget/events{/privacy}","received_events_url":"https://api.github.com/users/Flexget/received_events","type":"Organization","site_admin":false},"repo":{"id":1512901,"name":"Flexget","full_name":"Flexget/Flexget","owner":{"login":"Flexget","id":682553,"avatar_url":"https://avatars.githubusercontent.com/u/682553?v=3","gravatar_id":"","url":"https://api.github.com/users/Flexget","html_url":"https://github.com/Flexget","followers_url":"https://api.github.com/users/Flexget/followers","following_url":"https://api.github.com/users/Flexget/following{/other_user}","gists_url":"https://api.github.com/users/Flexget/gists{/gist_id}","starred_url":"https://api.github.com/users/Flexget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flexget/subscriptions","organizations_url":"https://api.github.com/users/Flexget/orgs","repos_url":"https://api.github.com/users/Flexget/repos","events_url":"https://api.github.com/users/Flexget/events{/privacy}","received_events_url":"https://api.github.com/users/Flexget/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Flexget/Flexget","description":"The official FlexGet repository","fork":false,"url":"https://api.github.com/repos/Flexget/Flexget","forks_url":"https://api.github.com/repos/Flexget/Flexget/forks","keys_url":"https://api.github.com/repos/Flexget/Flexget/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Flexget/Flexget/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Flexget/Flexget/teams","hooks_url":"https://api.github.com/repos/Flexget/Flexget/hooks","issue_events_url":"https://api.github.com/repos/Flexget/Flexget/issues/events{/number}","events_url":"https://api.github.com/repos/Flexget/Flexget/events","assignees_url":"https://api.github.com/repos/Flexget/Flexget/assignees{/user}","branches_url":"https://api.github.com/repos/Flexget/Flexget/branches{/branch}","tags_url":"https://api.github.com/repos/Flexget/Flexget/tags","blobs_url":"https://api.github.com/repos/Flexget/Flexget/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Flexget/Flexget/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Flexget/Flexget/git/refs{/sha}","trees_url":"https://api.github.com/repos/Flexget/Flexget/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Flexget/Flexget/statuses/{sha}","languages_url":"https://api.github.com/repos/Flexget/Flexget/languages","stargazers_url":"https://api.github.com/repos/Flexget/Flexget/stargazers","contributors_url":"https://api.github.com/repos/Flexget/Flexget/contributors","subscribers_url":"https://api.github.com/repos/Flexget/Flexget/subscribers","subscription_url":"https://api.github.com/repos/Flexget/Flexget/subscription","commits_url":"https://api.github.com/repos/Flexget/Flexget/commits{/sha}","git_commits_url":"https://api.github.com/repos/Flexget/Flexget/git/commits{/sha}","comments_url":"https://api.github.com/repos/Flexget/Flexget/comments{/number}","issue_comment_url":"https://api.github.com/repos/Flexget/Flexget/issues/comments{/number}","contents_url":"https://api.github.com/repos/Flexget/Flexget/contents/{+path}","compare_url":"https://api.github.com/repos/Flexget/Flexget/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Flexget/Flexget/merges","archive_url":"https://api.github.com/repos/Flexget/Flexget/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Flexget/Flexget/downloads","issues_url":"https://api.github.com/repos/Flexget/Flexget/issues{/number}","pulls_url":"https://api.github.com/repos/Flexget/Flexget/pulls{/number}","milestones_url":"https://api.github.com/repos/Flexget/Flexget/milestones{/number}","notifications_url":"https://api.github.com/repos/Flexget/Flexget/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Flexget/Flexget/labels{/name}","releases_url":"https://api.github.com/repos/Flexget/Flexget/releases{/id}","deployments_url":"https://api.github.com/repos/Flexget/Flexget/deployments","created_at":"2011-03-22T19:33:44Z","updated_at":"2016-04-17T04:01:32Z","pushed_at":"2016-04-20T19:09:24Z","git_url":"git://github.com/Flexget/Flexget.git","ssh_url":"git@github.com:Flexget/Flexget.git","clone_url":"https://github.com/Flexget/Flexget.git","svn_url":"https://github.com/Flexget/Flexget","homepage":"http://www.flexget.com","size":42942,"stargazers_count":466,"watchers_count":466,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":282,"mirror_url":null,"open_issues_count":71,"forks":282,"open_issues":71,"watchers":466,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Flexget/Flexget/pulls/1052"},"html":{"href":"https://github.com/Flexget/Flexget/pull/1052"},"issue":{"href":"https://api.github.com/repos/Flexget/Flexget/issues/1052"},"comments":{"href":"https://api.github.com/repos/Flexget/Flexget/issues/1052/comments"},"review_comments":{"href":"https://api.github.com/repos/Flexget/Flexget/pulls/1052/comments"},"review_comment":{"href":"https://api.github.com/repos/Flexget/Flexget/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Flexget/Flexget/pulls/1052/commits"},"statuses":{"href":"https://api.github.com/repos/Flexget/Flexget/statuses/ef7f72f6b8474f90726f988b1e1fd559bdec4740"}}}}