{"action":"created","comment":{"url":"https://api.github.com/repos/KeitIG/museeks/pulls/comments/84600859","pull_request_review_id":5368951,"id":84600859,"diff_hunk":"@@ -3,146 +3,145 @@ import app    from '../lib/app';\n \n import LibraryActions       from './LibraryActions';\n import PlaylistsActions     from './PlaylistsActions';\n-import NotificationsActions from './NotificationsActions';\n import PlayerActions        from './PlayerActions';\n-import QueueActions         from './QueueActions';\n import SettingsActions      from './SettingsActions';\n \n const globalShortcut = electron.remote.globalShortcut;\n const ipcRenderer    = electron.ipcRenderer;\n+const player         = PlayerActions;\n+const playlists      = PlaylistsActions;\n+const library        = LibraryActions;\n+const settings       = SettingsActions;\n+\n+const init = () => {\n+    // Usual tasks\n+    library.load();\n+    playlists.refresh();\n+    settings.check();\n+    initShortcuts();\n+    start();\n+\n+    // Bind player events\n+    // Audio Events\n+    Player.getAudio().addEventListener('ended', player.next);\n+    Player.getAudio().addEventListener('error', player.audioError);\n+    Player.getAudio().addEventListener('timeupdate', () => {\n+        if (Player.isThresholdReached()) {\n+            LibraryActions.incrementPlayCount(Player.getAudio().src);\n+        }\n+    });\n+    Player.getAudio().addEventListener('play', () => {\n+        ipcRenderer.send('playerAction', 'play');\n+    });\n+    Player.getAudio().addEventListener('pause', () => {\n+        ipcRenderer.send('playerAction', 'pause');\n+    });\n+\n+    // Listen for main-process events\n+    ipcRenderer.on('playerAction', (event, reply) => {\n+\n+        switch(reply) {\n+            case 'play':\n+                player.play();\n+                break;\n+            case 'pause':\n+                player.pause();\n+                break;\n+            case 'prev':\n+                player.previous();\n+                break;\n+            case 'next':\n+                player.next();\n+                break;\n+        }\n+    });\n \n+    // Prevent some events\n+    window.addEventListener('dragover', (e) => {\n+        e.preventDefault();\n+    }, false);\n \n-const AppActions = {\n-\n-    player        : PlayerActions,\n-    playlists     : PlaylistsActions,\n-    queue         : QueueActions,\n-    library       : LibraryActions,\n-    settings      : SettingsActions,\n-    notifications : NotificationsActions,\n-\n-    init: function() {\n-\n-        // Usual tasks\n-        this.library.load();\n-        this.playlists.refresh();\n-        this.settings.check();\n-        this.app.initShortcuts();\n-        this.app.start();\n-\n-        // Bind player events\n-        // Audio Events\n-        Player.getAudio().addEventListener('ended', AppActions.player.next);\n-        Player.getAudio().addEventListener('error', AppActions.player.audioError);\n-        Player.getAudio().addEventListener('timeupdate', () => {\n-            if (Player.isThresholdReached()) {\n-                LibraryActions.incrementPlayCount(Player.getAudio().src);\n-            }\n-        });\n-        Player.getAudio().addEventListener('play', () => {\n-            ipcRenderer.send('playerAction', 'play');\n-        });\n-        Player.getAudio().addEventListener('pause', () => {\n-            ipcRenderer.send('playerAction', 'pause');\n-        });\n-\n-        // Listen for main-process events\n-        ipcRenderer.on('playerAction', (event, reply) => {\n-\n-            switch(reply) {\n-                case 'play':\n-                    AppActions.player.play();\n-                    break;\n-                case 'pause':\n-                    AppActions.player.pause();\n-                    break;\n-                case 'prev':\n-                    AppActions.player.previous();\n-                    break;\n-                case 'next':\n-                    AppActions.player.next();\n-                    break;\n-            }\n-        });\n-\n-        // Prevent some events\n-        window.addEventListener('dragover', (e) => {\n-            e.preventDefault();\n-        }, false);\n-\n-        window.addEventListener('drop', (e) => {\n-            e.preventDefault();\n-        }, false);\n-\n-        // Remember dimensions and positionning\n-        const currentWindow = app.browserWindows.main;\n-\n-        currentWindow.on('resize', () => {\n-            AppActions.app.saveBounds();\n-        });\n-\n-        currentWindow.on('move', () => {\n-            AppActions.app.saveBounds();\n-        });\n-    },\n-\n-    app: {\n-\n-        start: function() {\n-            ipcRenderer.send('appReady');\n-        },\n-\n-        restart: function() {\n-            ipcRenderer.send('appRestart');\n-        },\n-\n-        close: function() {\n-            app.browserWindows.main.close();\n-        },\n-\n-        minimize: function() {\n-            app.browserWindows.main.minimize();\n-        },\n-\n-        maximize: function() {\n-            app.browserWindows.main.isMaximized() ? app.browserWindows.main.unmaximize() : app.browserWindows.main.maximize();\n-        },\n-\n-        saveBounds: function() {\n-\n-            const self = AppActions;\n-            const now = window.performance.now();\n-\n-            if (now - self.lastFilterSearch < 250) {\n-                clearTimeout(self.filterSearchTimeOut);\n-            }\n-\n-            self.lastFilterSearch = now;\n-\n-            self.filterSearchTimeOut = setTimeout(() => {\n-\n-                app.config.set('bounds', app.browserWindows.main.getBounds());\n-                app.config.saveSync();\n-\n-            }, 250);\n-        },\n-\n-        initShortcuts: function() {\n-\n-            // Global shortcuts - Player\n-            globalShortcut.register('MediaPlayPause', () => {\n-                AppActions.player.playToggle();\n-            });\n-\n-            globalShortcut.register('MediaPreviousTrack', () => {\n-                AppActions.player.previous();\n-            });\n-\n-            globalShortcut.register('MediaNextTrack', () => {\n-                AppActions.player.next();\n-            });\n-        }\n+    window.addEventListener('drop', (e) => {\n+        e.preventDefault();\n+    }, false);\n+\n+    // Remember dimensions and positionning\n+    const currentWindow = app.browserWindows.main;\n+\n+    currentWindow.on('resize', () => {\n+        saveBounds();\n+    });\n+\n+    currentWindow.on('move', () => {\n+        saveBounds();\n+    });","path":"src/js/actions/AppActions.js","position":207,"original_position":207,"commit_id":"74dbb2793fd993da53eb74b3f9dabb2c55820931","original_commit_id":"74dbb2793fd993da53eb74b3f9dabb2c55820931","user":{"login":"YurySolovyov","id":2168518,"avatar_url":"https://avatars.githubusercontent.com/u/2168518?v=3","gravatar_id":"","url":"https://api.github.com/users/YurySolovyov","html_url":"https://github.com/YurySolovyov","followers_url":"https://api.github.com/users/YurySolovyov/followers","following_url":"https://api.github.com/users/YurySolovyov/following{/other_user}","gists_url":"https://api.github.com/users/YurySolovyov/gists{/gist_id}","starred_url":"https://api.github.com/users/YurySolovyov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YurySolovyov/subscriptions","organizations_url":"https://api.github.com/users/YurySolovyov/orgs","repos_url":"https://api.github.com/users/YurySolovyov/repos","events_url":"https://api.github.com/users/YurySolovyov/events{/privacy}","received_events_url":"https://api.github.com/users/YurySolovyov/received_events","type":"User","site_admin":false},"body":"I guess this can be just `currentWindow.on('move', saveBounds);` and so on.","created_at":"2016-10-23T18:09:03Z","updated_at":"2016-10-23T18:09:03Z","html_url":"https://github.com/KeitIG/museeks/pull/236#discussion_r84600859","pull_request_url":"https://api.github.com/repos/KeitIG/museeks/pulls/236","_links":{"self":{"href":"https://api.github.com/repos/KeitIG/museeks/pulls/comments/84600859"},"html":{"href":"https://github.com/KeitIG/museeks/pull/236#discussion_r84600859"},"pull_request":{"href":"https://api.github.com/repos/KeitIG/museeks/pulls/236"}}},"pull_request":{"url":"https://api.github.com/repos/KeitIG/museeks/pulls/236","id":90516318,"html_url":"https://github.com/KeitIG/museeks/pull/236","diff_url":"https://github.com/KeitIG/museeks/pull/236.diff","patch_url":"https://github.com/KeitIG/museeks/pull/236.patch","issue_url":"https://api.github.com/repos/KeitIG/museeks/issues/236","number":236,"state":"open","locked":false,"title":"Refactor action creators export.","user":{"login":"cfollet","id":5993096,"avatar_url":"https://avatars.githubusercontent.com/u/5993096?v=3","gravatar_id":"","url":"https://api.github.com/users/cfollet","html_url":"https://github.com/cfollet","followers_url":"https://api.github.com/users/cfollet/followers","following_url":"https://api.github.com/users/cfollet/following{/other_user}","gists_url":"https://api.github.com/users/cfollet/gists{/gist_id}","starred_url":"https://api.github.com/users/cfollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfollet/subscriptions","organizations_url":"https://api.github.com/users/cfollet/orgs","repos_url":"https://api.github.com/users/cfollet/repos","events_url":"https://api.github.com/users/cfollet/events{/privacy}","received_events_url":"https://api.github.com/users/cfollet/received_events","type":"User","site_admin":false},"body":"Not sure about the AppAction refactor. Need review please.\r\nFixes #222.","created_at":"2016-10-23T13:57:48Z","updated_at":"2016-10-23T18:12:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27f9c4c6214fd156fb756e7972919e556fcc0145","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/KeitIG/museeks/pulls/236/commits","review_comments_url":"https://api.github.com/repos/KeitIG/museeks/pulls/236/comments","review_comment_url":"https://api.github.com/repos/KeitIG/museeks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KeitIG/museeks/issues/236/comments","statuses_url":"https://api.github.com/repos/KeitIG/museeks/statuses/74dbb2793fd993da53eb74b3f9dabb2c55820931","head":{"label":"cfollet:222-refactor-action-creators-exports","ref":"222-refactor-action-creators-exports","sha":"74dbb2793fd993da53eb74b3f9dabb2c55820931","user":{"login":"cfollet","id":5993096,"avatar_url":"https://avatars.githubusercontent.com/u/5993096?v=3","gravatar_id":"","url":"https://api.github.com/users/cfollet","html_url":"https://github.com/cfollet","followers_url":"https://api.github.com/users/cfollet/followers","following_url":"https://api.github.com/users/cfollet/following{/other_user}","gists_url":"https://api.github.com/users/cfollet/gists{/gist_id}","starred_url":"https://api.github.com/users/cfollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfollet/subscriptions","organizations_url":"https://api.github.com/users/cfollet/orgs","repos_url":"https://api.github.com/users/cfollet/repos","events_url":"https://api.github.com/users/cfollet/events{/privacy}","received_events_url":"https://api.github.com/users/cfollet/received_events","type":"User","site_admin":false},"repo":{"id":67413788,"name":"museeks","full_name":"cfollet/museeks","owner":{"login":"cfollet","id":5993096,"avatar_url":"https://avatars.githubusercontent.com/u/5993096?v=3","gravatar_id":"","url":"https://api.github.com/users/cfollet","html_url":"https://github.com/cfollet","followers_url":"https://api.github.com/users/cfollet/followers","following_url":"https://api.github.com/users/cfollet/following{/other_user}","gists_url":"https://api.github.com/users/cfollet/gists{/gist_id}","starred_url":"https://api.github.com/users/cfollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfollet/subscriptions","organizations_url":"https://api.github.com/users/cfollet/orgs","repos_url":"https://api.github.com/users/cfollet/repos","events_url":"https://api.github.com/users/cfollet/events{/privacy}","received_events_url":"https://api.github.com/users/cfollet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cfollet/museeks","description":"A simple, clean and cross-platform music player","fork":true,"url":"https://api.github.com/repos/cfollet/museeks","forks_url":"https://api.github.com/repos/cfollet/museeks/forks","keys_url":"https://api.github.com/repos/cfollet/museeks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfollet/museeks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfollet/museeks/teams","hooks_url":"https://api.github.com/repos/cfollet/museeks/hooks","issue_events_url":"https://api.github.com/repos/cfollet/museeks/issues/events{/number}","events_url":"https://api.github.com/repos/cfollet/museeks/events","assignees_url":"https://api.github.com/repos/cfollet/museeks/assignees{/user}","branches_url":"https://api.github.com/repos/cfollet/museeks/branches{/branch}","tags_url":"https://api.github.com/repos/cfollet/museeks/tags","blobs_url":"https://api.github.com/repos/cfollet/museeks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfollet/museeks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfollet/museeks/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfollet/museeks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfollet/museeks/statuses/{sha}","languages_url":"https://api.github.com/repos/cfollet/museeks/languages","stargazers_url":"https://api.github.com/repos/cfollet/museeks/stargazers","contributors_url":"https://api.github.com/repos/cfollet/museeks/contributors","subscribers_url":"https://api.github.com/repos/cfollet/museeks/subscribers","subscription_url":"https://api.github.com/repos/cfollet/museeks/subscription","commits_url":"https://api.github.com/repos/cfollet/museeks/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfollet/museeks/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfollet/museeks/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfollet/museeks/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfollet/museeks/contents/{+path}","compare_url":"https://api.github.com/repos/cfollet/museeks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfollet/museeks/merges","archive_url":"https://api.github.com/repos/cfollet/museeks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfollet/museeks/downloads","issues_url":"https://api.github.com/repos/cfollet/museeks/issues{/number}","pulls_url":"https://api.github.com/repos/cfollet/museeks/pulls{/number}","milestones_url":"https://api.github.com/repos/cfollet/museeks/milestones{/number}","notifications_url":"https://api.github.com/repos/cfollet/museeks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfollet/museeks/labels{/name}","releases_url":"https://api.github.com/repos/cfollet/museeks/releases{/id}","deployments_url":"https://api.github.com/repos/cfollet/museeks/deployments","created_at":"2016-09-05T11:05:00Z","updated_at":"2016-10-22T08:39:40Z","pushed_at":"2016-10-23T13:54:28Z","git_url":"git://github.com/cfollet/museeks.git","ssh_url":"git@github.com:cfollet/museeks.git","clone_url":"https://github.com/cfollet/museeks.git","svn_url":"https://github.com/cfollet/museeks","homepage":"http://museeks.io","size":4520,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"KeitIG:master","ref":"master","sha":"4654e8e9dcc4cd8440b3f0632b5cf0632622dbdb","user":{"login":"KeitIG","id":1311607,"avatar_url":"https://avatars.githubusercontent.com/u/1311607?v=3","gravatar_id":"","url":"https://api.github.com/users/KeitIG","html_url":"https://github.com/KeitIG","followers_url":"https://api.github.com/users/KeitIG/followers","following_url":"https://api.github.com/users/KeitIG/following{/other_user}","gists_url":"https://api.github.com/users/KeitIG/gists{/gist_id}","starred_url":"https://api.github.com/users/KeitIG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KeitIG/subscriptions","organizations_url":"https://api.github.com/users/KeitIG/orgs","repos_url":"https://api.github.com/users/KeitIG/repos","events_url":"https://api.github.com/users/KeitIG/events{/privacy}","received_events_url":"https://api.github.com/users/KeitIG/received_events","type":"User","site_admin":false},"repo":{"id":31598574,"name":"museeks","full_name":"KeitIG/museeks","owner":{"login":"KeitIG","id":1311607,"avatar_url":"https://avatars.githubusercontent.com/u/1311607?v=3","gravatar_id":"","url":"https://api.github.com/users/KeitIG","html_url":"https://github.com/KeitIG","followers_url":"https://api.github.com/users/KeitIG/followers","following_url":"https://api.github.com/users/KeitIG/following{/other_user}","gists_url":"https://api.github.com/users/KeitIG/gists{/gist_id}","starred_url":"https://api.github.com/users/KeitIG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KeitIG/subscriptions","organizations_url":"https://api.github.com/users/KeitIG/orgs","repos_url":"https://api.github.com/users/KeitIG/repos","events_url":"https://api.github.com/users/KeitIG/events{/privacy}","received_events_url":"https://api.github.com/users/KeitIG/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KeitIG/museeks","description":"A simple, clean and cross-platform music player","fork":false,"url":"https://api.github.com/repos/KeitIG/museeks","forks_url":"https://api.github.com/repos/KeitIG/museeks/forks","keys_url":"https://api.github.com/repos/KeitIG/museeks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KeitIG/museeks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KeitIG/museeks/teams","hooks_url":"https://api.github.com/repos/KeitIG/museeks/hooks","issue_events_url":"https://api.github.com/repos/KeitIG/museeks/issues/events{/number}","events_url":"https://api.github.com/repos/KeitIG/museeks/events","assignees_url":"https://api.github.com/repos/KeitIG/museeks/assignees{/user}","branches_url":"https://api.github.com/repos/KeitIG/museeks/branches{/branch}","tags_url":"https://api.github.com/repos/KeitIG/museeks/tags","blobs_url":"https://api.github.com/repos/KeitIG/museeks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KeitIG/museeks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KeitIG/museeks/git/refs{/sha}","trees_url":"https://api.github.com/repos/KeitIG/museeks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KeitIG/museeks/statuses/{sha}","languages_url":"https://api.github.com/repos/KeitIG/museeks/languages","stargazers_url":"https://api.github.com/repos/KeitIG/museeks/stargazers","contributors_url":"https://api.github.com/repos/KeitIG/museeks/contributors","subscribers_url":"https://api.github.com/repos/KeitIG/museeks/subscribers","subscription_url":"https://api.github.com/repos/KeitIG/museeks/subscription","commits_url":"https://api.github.com/repos/KeitIG/museeks/commits{/sha}","git_commits_url":"https://api.github.com/repos/KeitIG/museeks/git/commits{/sha}","comments_url":"https://api.github.com/repos/KeitIG/museeks/comments{/number}","issue_comment_url":"https://api.github.com/repos/KeitIG/museeks/issues/comments{/number}","contents_url":"https://api.github.com/repos/KeitIG/museeks/contents/{+path}","compare_url":"https://api.github.com/repos/KeitIG/museeks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KeitIG/museeks/merges","archive_url":"https://api.github.com/repos/KeitIG/museeks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KeitIG/museeks/downloads","issues_url":"https://api.github.com/repos/KeitIG/museeks/issues{/number}","pulls_url":"https://api.github.com/repos/KeitIG/museeks/pulls{/number}","milestones_url":"https://api.github.com/repos/KeitIG/museeks/milestones{/number}","notifications_url":"https://api.github.com/repos/KeitIG/museeks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KeitIG/museeks/labels{/name}","releases_url":"https://api.github.com/repos/KeitIG/museeks/releases{/id}","deployments_url":"https://api.github.com/repos/KeitIG/museeks/deployments","created_at":"2015-03-03T13:01:31Z","updated_at":"2016-10-23T09:25:23Z","pushed_at":"2016-10-23T13:57:48Z","git_url":"git://github.com/KeitIG/museeks.git","ssh_url":"git@github.com:KeitIG/museeks.git","clone_url":"https://github.com/KeitIG/museeks.git","svn_url":"https://github.com/KeitIG/museeks","homepage":"http://museeks.io","size":4590,"stargazers_count":254,"watchers_count":254,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":49,"forks":40,"open_issues":49,"watchers":254,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KeitIG/museeks/pulls/236"},"html":{"href":"https://github.com/KeitIG/museeks/pull/236"},"issue":{"href":"https://api.github.com/repos/KeitIG/museeks/issues/236"},"comments":{"href":"https://api.github.com/repos/KeitIG/museeks/issues/236/comments"},"review_comments":{"href":"https://api.github.com/repos/KeitIG/museeks/pulls/236/comments"},"review_comment":{"href":"https://api.github.com/repos/KeitIG/museeks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KeitIG/museeks/pulls/236/commits"},"statuses":{"href":"https://api.github.com/repos/KeitIG/museeks/statuses/74dbb2793fd993da53eb74b3f9dabb2c55820931"}}}}
{"actor":{"display_login":"YurySolovyov"}}