{"action":"created","comment":{"url":"https://api.github.com/repos/Syncplay/syncplay/pulls/comments/205262595","pull_request_review_id":140496218,"id":205262595,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTI2MjU5NQ==","diff_hunk":"@@ -260,6 +280,16 @@ def moveWatcher(self, watcher, room):\n         RoomManager.moveWatcher(self, watcher, room)\n         watcher.setFile(watcher.getFile())\n \n+    def runClientSnapshot(self, dbHandler, portNumber):\n+        snapshotTime = int(time.time())\n+        c = dbHandler.cursor()\n+        for idx, room in enumerate(self._rooms.values()):\n+            playStatus = room.isPlaying()\n+            for watcher in room.getWatchers():\n+                content = (snapshotTime, int(portNumber), watcher.getVersion(), idx, playStatus, )\n+                c.execute(\"INSERT INTO clients_snapshots VALUES (?, ?, ?, ?, ?)\", content)","path":"syncplay/server.py","position":66,"original_position":66,"commit_id":"bd766b4dfacf9a646762fbdb7356282a88fe746f","original_commit_id":"bd766b4dfacf9a646762fbdb7356282a88fe746f","user":{"login":"Uriziel","id":1389837,"node_id":"MDQ6VXNlcjEzODk4Mzc=","avatar_url":"https://avatars2.githubusercontent.com/u/1389837?v=4","gravatar_id":"","url":"https://api.github.com/users/Uriziel","html_url":"https://github.com/Uriziel","followers_url":"https://api.github.com/users/Uriziel/followers","following_url":"https://api.github.com/users/Uriziel/following{/other_user}","gists_url":"https://api.github.com/users/Uriziel/gists{/gist_id}","starred_url":"https://api.github.com/users/Uriziel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Uriziel/subscriptions","organizations_url":"https://api.github.com/users/Uriziel/orgs","repos_url":"https://api.github.com/users/Uriziel/repos","events_url":"https://api.github.com/users/Uriziel/events{/privacy}","received_events_url":"https://api.github.com/users/Uriziel/received_events","type":"User","site_admin":false},"body":"instead of room-idx just store the room-name hash.","created_at":"2018-07-25T21:06:36Z","updated_at":"2018-07-25T21:07:05Z","html_url":"https://github.com/Syncplay/syncplay/pull/196#discussion_r205262595","pull_request_url":"https://api.github.com/repos/Syncplay/syncplay/pulls/196","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Syncplay/syncplay/pulls/comments/205262595"},"html":{"href":"https://github.com/Syncplay/syncplay/pull/196#discussion_r205262595"},"pull_request":{"href":"https://api.github.com/repos/Syncplay/syncplay/pulls/196"}},"in_reply_to_id":205261940},"pull_request":{"url":"https://api.github.com/repos/Syncplay/syncplay/pulls/196","id":203886383,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzODg2Mzgz","html_url":"https://github.com/Syncplay/syncplay/pull/196","diff_url":"https://github.com/Syncplay/syncplay/pull/196.diff","patch_url":"https://github.com/Syncplay/syncplay/pull/196.patch","issue_url":"https://api.github.com/repos/Syncplay/syncplay/issues/196","number":196,"state":"open","locked":false,"title":"Allow collection of server statistical data","user":{"login":"albertosottile","id":7440277,"node_id":"MDQ6VXNlcjc0NDAyNzc=","avatar_url":"https://avatars3.githubusercontent.com/u/7440277?v=4","gravatar_id":"","url":"https://api.github.com/users/albertosottile","html_url":"https://github.com/albertosottile","followers_url":"https://api.github.com/users/albertosottile/followers","following_url":"https://api.github.com/users/albertosottile/following{/other_user}","gists_url":"https://api.github.com/users/albertosottile/gists{/gist_id}","starred_url":"https://api.github.com/users/albertosottile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertosottile/subscriptions","organizations_url":"https://api.github.com/users/albertosottile/orgs","repos_url":"https://api.github.com/users/albertosottile/repos","events_url":"https://api.github.com/users/albertosottile/events{/privacy}","received_events_url":"https://api.github.com/users/albertosottile/received_events","type":"User","site_admin":false},"body":"Because of the recent increase in the update rate of Syncplay, we would like to have some data on our currently user base. \r\n\r\nThis PR introduces a new server argument ` --stats-db-file [file]` that creates a SQLite database in [file] and stores some anonymous information in it. \r\n\r\nWe only store non-sensitive and non-personal data that are already being transmitted by the clients in the current protocol. Specifically, for every user in the server at the time of stats collection, we store:\r\n- server's Unix timestamp at the collection time\r\n- server's port\r\n- user's Syncplay client version\r\n- a numerical index that indicates that the user is in the n-th room of the server, without identifying it\r\n- play status of the n-th room\r\n\r\nData collection is scheduled to happen every hour. Nothing else is acquired nor stored in the snapshot. \r\n\r\nThanks to SQLite, full concurrency is supported and multiple servers can use the same DB file at the same time. For further safety, a fixed delay is introduced before the first collection, and its amount is based on the server's port number. ","created_at":"2018-07-25T16:00:08Z","updated_at":"2018-07-25T21:07:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"727f08a65120e3a974ebdc76125bfd69473006a2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Syncplay/syncplay/pulls/196/commits","review_comments_url":"https://api.github.com/repos/Syncplay/syncplay/pulls/196/comments","review_comment_url":"https://api.github.com/repos/Syncplay/syncplay/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Syncplay/syncplay/issues/196/comments","statuses_url":"https://api.github.com/repos/Syncplay/syncplay/statuses/bd766b4dfacf9a646762fbdb7356282a88fe746f","head":{"label":"albertosottile:master","ref":"master","sha":"bd766b4dfacf9a646762fbdb7356282a88fe746f","user":{"login":"albertosottile","id":7440277,"node_id":"MDQ6VXNlcjc0NDAyNzc=","avatar_url":"https://avatars3.githubusercontent.com/u/7440277?v=4","gravatar_id":"","url":"https://api.github.com/users/albertosottile","html_url":"https://github.com/albertosottile","followers_url":"https://api.github.com/users/albertosottile/followers","following_url":"https://api.github.com/users/albertosottile/following{/other_user}","gists_url":"https://api.github.com/users/albertosottile/gists{/gist_id}","starred_url":"https://api.github.com/users/albertosottile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertosottile/subscriptions","organizations_url":"https://api.github.com/users/albertosottile/orgs","repos_url":"https://api.github.com/users/albertosottile/repos","events_url":"https://api.github.com/users/albertosottile/events{/privacy}","received_events_url":"https://api.github.com/users/albertosottile/received_events","type":"User","site_admin":false},"repo":{"id":102724414,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI3MjQ0MTQ=","name":"syncplay","full_name":"albertosottile/syncplay","owner":{"login":"albertosottile","id":7440277,"node_id":"MDQ6VXNlcjc0NDAyNzc=","avatar_url":"https://avatars3.githubusercontent.com/u/7440277?v=4","gravatar_id":"","url":"https://api.github.com/users/albertosottile","html_url":"https://github.com/albertosottile","followers_url":"https://api.github.com/users/albertosottile/followers","following_url":"https://api.github.com/users/albertosottile/following{/other_user}","gists_url":"https://api.github.com/users/albertosottile/gists{/gist_id}","starred_url":"https://api.github.com/users/albertosottile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertosottile/subscriptions","organizations_url":"https://api.github.com/users/albertosottile/orgs","repos_url":"https://api.github.com/users/albertosottile/repos","events_url":"https://api.github.com/users/albertosottile/events{/privacy}","received_events_url":"https://api.github.com/users/albertosottile/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/albertosottile/syncplay","description":"Client/server to synchronize media playback on MPC-HC/VLC/mpv/mplayer2 on many computers","fork":true,"url":"https://api.github.com/repos/albertosottile/syncplay","forks_url":"https://api.github.com/repos/albertosottile/syncplay/forks","keys_url":"https://api.github.com/repos/albertosottile/syncplay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/albertosottile/syncplay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/albertosottile/syncplay/teams","hooks_url":"https://api.github.com/repos/albertosottile/syncplay/hooks","issue_events_url":"https://api.github.com/repos/albertosottile/syncplay/issues/events{/number}","events_url":"https://api.github.com/repos/albertosottile/syncplay/events","assignees_url":"https://api.github.com/repos/albertosottile/syncplay/assignees{/user}","branches_url":"https://api.github.com/repos/albertosottile/syncplay/branches{/branch}","tags_url":"https://api.github.com/repos/albertosottile/syncplay/tags","blobs_url":"https://api.github.com/repos/albertosottile/syncplay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/albertosottile/syncplay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/albertosottile/syncplay/git/refs{/sha}","trees_url":"https://api.github.com/repos/albertosottile/syncplay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/albertosottile/syncplay/statuses/{sha}","languages_url":"https://api.github.com/repos/albertosottile/syncplay/languages","stargazers_url":"https://api.github.com/repos/albertosottile/syncplay/stargazers","contributors_url":"https://api.github.com/repos/albertosottile/syncplay/contributors","subscribers_url":"https://api.github.com/repos/albertosottile/syncplay/subscribers","subscription_url":"https://api.github.com/repos/albertosottile/syncplay/subscription","commits_url":"https://api.github.com/repos/albertosottile/syncplay/commits{/sha}","git_commits_url":"https://api.github.com/repos/albertosottile/syncplay/git/commits{/sha}","comments_url":"https://api.github.com/repos/albertosottile/syncplay/comments{/number}","issue_comment_url":"https://api.github.com/repos/albertosottile/syncplay/issues/comments{/number}","contents_url":"https://api.github.com/repos/albertosottile/syncplay/contents/{+path}","compare_url":"https://api.github.com/repos/albertosottile/syncplay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/albertosottile/syncplay/merges","archive_url":"https://api.github.com/repos/albertosottile/syncplay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/albertosottile/syncplay/downloads","issues_url":"https://api.github.com/repos/albertosottile/syncplay/issues{/number}","pulls_url":"https://api.github.com/repos/albertosottile/syncplay/pulls{/number}","milestones_url":"https://api.github.com/repos/albertosottile/syncplay/milestones{/number}","notifications_url":"https://api.github.com/repos/albertosottile/syncplay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/albertosottile/syncplay/labels{/name}","releases_url":"https://api.github.com/repos/albertosottile/syncplay/releases{/id}","deployments_url":"https://api.github.com/repos/albertosottile/syncplay/deployments","created_at":"2017-09-07T10:32:40Z","updated_at":"2018-07-25T15:36:45Z","pushed_at":"2018-07-25T16:04:07Z","git_url":"git://github.com/albertosottile/syncplay.git","ssh_url":"git@github.com:albertosottile/syncplay.git","clone_url":"https://github.com/albertosottile/syncplay.git","svn_url":"https://github.com/albertosottile/syncplay","homepage":"http://syncplay.pl/","size":13607,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"Syncplay:master","ref":"master","sha":"1dac75326490d1fb06fd75a2ee9d3e7c94d20f72","user":{"login":"Syncplay","id":11097767,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMDk3NzY3","avatar_url":"https://avatars2.githubusercontent.com/u/11097767?v=4","gravatar_id":"","url":"https://api.github.com/users/Syncplay","html_url":"https://github.com/Syncplay","followers_url":"https://api.github.com/users/Syncplay/followers","following_url":"https://api.github.com/users/Syncplay/following{/other_user}","gists_url":"https://api.github.com/users/Syncplay/gists{/gist_id}","starred_url":"https://api.github.com/users/Syncplay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Syncplay/subscriptions","organizations_url":"https://api.github.com/users/Syncplay/orgs","repos_url":"https://api.github.com/users/Syncplay/repos","events_url":"https://api.github.com/users/Syncplay/events{/privacy}","received_events_url":"https://api.github.com/users/Syncplay/received_events","type":"Organization","site_admin":false},"repo":{"id":4732425,"node_id":"MDEwOlJlcG9zaXRvcnk0NzMyNDI1","name":"syncplay","full_name":"Syncplay/syncplay","owner":{"login":"Syncplay","id":11097767,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMDk3NzY3","avatar_url":"https://avatars2.githubusercontent.com/u/11097767?v=4","gravatar_id":"","url":"https://api.github.com/users/Syncplay","html_url":"https://github.com/Syncplay","followers_url":"https://api.github.com/users/Syncplay/followers","following_url":"https://api.github.com/users/Syncplay/following{/other_user}","gists_url":"https://api.github.com/users/Syncplay/gists{/gist_id}","starred_url":"https://api.github.com/users/Syncplay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Syncplay/subscriptions","organizations_url":"https://api.github.com/users/Syncplay/orgs","repos_url":"https://api.github.com/users/Syncplay/repos","events_url":"https://api.github.com/users/Syncplay/events{/privacy}","received_events_url":"https://api.github.com/users/Syncplay/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Syncplay/syncplay","description":"Client/server to synchronize media playback on MPC-HC/VLC/mpv/mplayer2 on many computers","fork":false,"url":"https://api.github.com/repos/Syncplay/syncplay","forks_url":"https://api.github.com/repos/Syncplay/syncplay/forks","keys_url":"https://api.github.com/repos/Syncplay/syncplay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Syncplay/syncplay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Syncplay/syncplay/teams","hooks_url":"https://api.github.com/repos/Syncplay/syncplay/hooks","issue_events_url":"https://api.github.com/repos/Syncplay/syncplay/issues/events{/number}","events_url":"https://api.github.com/repos/Syncplay/syncplay/events","assignees_url":"https://api.github.com/repos/Syncplay/syncplay/assignees{/user}","branches_url":"https://api.github.com/repos/Syncplay/syncplay/branches{/branch}","tags_url":"https://api.github.com/repos/Syncplay/syncplay/tags","blobs_url":"https://api.github.com/repos/Syncplay/syncplay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Syncplay/syncplay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Syncplay/syncplay/git/refs{/sha}","trees_url":"https://api.github.com/repos/Syncplay/syncplay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Syncplay/syncplay/statuses/{sha}","languages_url":"https://api.github.com/repos/Syncplay/syncplay/languages","stargazers_url":"https://api.github.com/repos/Syncplay/syncplay/stargazers","contributors_url":"https://api.github.com/repos/Syncplay/syncplay/contributors","subscribers_url":"https://api.github.com/repos/Syncplay/syncplay/subscribers","subscription_url":"https://api.github.com/repos/Syncplay/syncplay/subscription","commits_url":"https://api.github.com/repos/Syncplay/syncplay/commits{/sha}","git_commits_url":"https://api.github.com/repos/Syncplay/syncplay/git/commits{/sha}","comments_url":"https://api.github.com/repos/Syncplay/syncplay/comments{/number}","issue_comment_url":"https://api.github.com/repos/Syncplay/syncplay/issues/comments{/number}","contents_url":"https://api.github.com/repos/Syncplay/syncplay/contents/{+path}","compare_url":"https://api.github.com/repos/Syncplay/syncplay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Syncplay/syncplay/merges","archive_url":"https://api.github.com/repos/Syncplay/syncplay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Syncplay/syncplay/downloads","issues_url":"https://api.github.com/repos/Syncplay/syncplay/issues{/number}","pulls_url":"https://api.github.com/repos/Syncplay/syncplay/pulls{/number}","milestones_url":"https://api.github.com/repos/Syncplay/syncplay/milestones{/number}","notifications_url":"https://api.github.com/repos/Syncplay/syncplay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Syncplay/syncplay/labels{/name}","releases_url":"https://api.github.com/repos/Syncplay/syncplay/releases{/id}","deployments_url":"https://api.github.com/repos/Syncplay/syncplay/deployments","created_at":"2012-06-20T22:49:36Z","updated_at":"2018-07-24T17:52:06Z","pushed_at":"2018-07-25T16:00:09Z","git_url":"git://github.com/Syncplay/syncplay.git","ssh_url":"git@github.com:Syncplay/syncplay.git","clone_url":"https://github.com/Syncplay/syncplay.git","svn_url":"https://github.com/Syncplay/syncplay","homepage":"http://syncplay.pl/","size":13698,"stargazers_count":353,"watchers_count":353,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":56,"open_issues":4,"watchers":353,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Syncplay/syncplay/pulls/196"},"html":{"href":"https://github.com/Syncplay/syncplay/pull/196"},"issue":{"href":"https://api.github.com/repos/Syncplay/syncplay/issues/196"},"comments":{"href":"https://api.github.com/repos/Syncplay/syncplay/issues/196/comments"},"review_comments":{"href":"https://api.github.com/repos/Syncplay/syncplay/pulls/196/comments"},"review_comment":{"href":"https://api.github.com/repos/Syncplay/syncplay/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Syncplay/syncplay/pulls/196/commits"},"statuses":{"href":"https://api.github.com/repos/Syncplay/syncplay/statuses/bd766b4dfacf9a646762fbdb7356282a88fe746f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"Uriziel"}}