{"action":"created","comment":{"url":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/comments/23606755","id":23606755,"diff_hunk":"@@ -93,65 +85,63 @@ class PirodxEAM\n       index = 1\n       return $q (resolve, reject) ->\n         ml = IIDX.music_list\n-        request_loop = (p) -> p.then( ->\n-          new_p = $http.get(ml.get_url(sp_dp, version, index))\n-          .success( (page, status, headers) ->\n-            if ml.get_page_type(page) == ml.PAGE_TYPE_NOT_EXIST\n-              reject @REJECT_TYPE_ML_PAGE_NOT_EXIST\n-              return\n-            music_index = ml.get_index_by_music_name(page, name)\n-            if music_index != null # found music\n-              resolve music_index\n-              return\n-            if ml.is_last_page(page) # final page and not found\n-              reject @REJECT_TYPE_ML_NO_MUSIC_FOUND\n-            else # next page\n-              index += 1\n-              request_loop(new_p)\n-            return\n-          )\n-          .error( (page, status, headers) ->\n-            console.error \"PirodxService: Request fail with status -> #{status}\"\n-            reject @REJECT_TYPE_UNKNOWN\n-            return\n-          )\n-        )\n+        request_loop = (p) ->\n+          p.then ->\n+            new_p = $http.get(ml.get_url(sp_dp, version, index))\n+              .success (page, status, headers) ->\n+                if ml.get_page_type(page) == ml.PAGE_TYPE_NOT_EXIST\n+                  reject @REJECT_TYPE_ML_PAGE_NOT_EXIST\n+                  return\n+                music_index = ml.get_index_by_music_name(page, name)\n+                if music_index != null # found music\n+                  resolve music_index\n+                  return\n+                if ml.is_last_page(page) # final page and not found\n+                  reject @REJECT_TYPE_ML_NO_MUSIC_FOUND\n+                else # next page\n+                  index += 1\n+                  request_loop(new_p)\n+                return\n+              .error (page, status, headers) ->\n+                console.error \"PirodxService: Request fail with status -> #{status}\"\n+                reject @REJECT_TYPE_UNKNOWN\n+                return\n         request_loop($q (_resolve, _reject) -> _resolve(null)) # fire initial promise\n \n     @dl_result_by_music_name = (sp_dp, name, version, token) ->\n       mi = IIDX.music_info\n       return $q (resolve, reject) =>\n-        @_dl_index_by_music_name(sp_dp, name, version, token).then( (index) ->\n-          $http.get(mi.get_url(index, token))\n-            .success( (page, status, headers) ->\n-              if mi.get_page_type(page) == mi.PAGE_TYPE_NOT_EXIST\n-                reject @REJECT_TYPE_MI_PAGE_NOT_EXIST\n-              else\n-                resolve if token then mi.get_result_rival(page) else mi.get_result(page)\n-              return\n-            )\n-        ).catch( (reject_type) ->\n-          reject reject_type\n-        )\n+        @_dl_index_by_music_name(sp_dp, name, version, token)\n+          .then (index) ->\n+            $http.get(mi.get_url(index, token))\n+              .success (page, status, headers) ->\n+                if mi.get_page_type(page) == mi.PAGE_TYPE_NOT_EXIST\n+                  reject @REJECT_TYPE_MI_PAGE_NOT_EXIST\n+                else\n+                  resolve if token then mi.get_result_rival(page) else mi.get_result(page)\n+                return\n+          .catch (reject_type) ->\n+            reject reject_type\n \n     @dl_result_all = (sp_dp, token, versions=[0..21]) ->\n       return $q (resolve, reject) =>\n         mi = IIDX.music_info\n         index = 0\n         res = {my_result: [], rival_result: []}\n-        request_loop = (p) => p.then( =>\n-          new_p = @dl_result_by_version(sp_dp, versions[index], token)\n-          .then( (result_of_version) ->\n-            Array.prototype.push.apply(res.my_result, result_of_version.my_result)\n-            if index < versions.length - 1\n-              index += 1\n-              request_loop(new_p)\n-            else # when complete all versions\n-              resolve res\n-            return\n-          , (reject_type) -> reject reject_type\n-          )\n-        )\n+        request_loop = (p) =>\n+          p.then =>\n+            new_p = @dl_result_by_version(sp_dp, versions[index], token)\n+              .then(\n+                (result_of_version) ->\n+                  Array.prototype.push.apply(res.my_result, result_of_version.my_result)\n+                  if index < versions.length - 1\n+                    index += 1\n+                    request_loop(new_p)\n+                  else # when complete all versions\n+                    resolve res\n+                  return\n+                , (reject_type) -> reject reject_type","path":"app/scripts/service/PirodxEAM.coffee","position":237,"original_position":237,"commit_id":"e6295c551dffeadad77a94ac1deeb383db86c539","original_commit_id":"e6295c551dffeadad77a94ac1deeb383db86c539","user":{"login":"kenji0919","id":2742315,"avatar_url":"https://avatars.githubusercontent.com/u/2742315?v=3","gravatar_id":"","url":"https://api.github.com/users/kenji0919","html_url":"https://github.com/kenji0919","followers_url":"https://api.github.com/users/kenji0919/followers","following_url":"https://api.github.com/users/kenji0919/following{/other_user}","gists_url":"https://api.github.com/users/kenji0919/gists{/gist_id}","starred_url":"https://api.github.com/users/kenji0919/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenji0919/subscriptions","organizations_url":"https://api.github.com/users/kenji0919/orgs","repos_url":"https://api.github.com/users/kenji0919/repos","events_url":"https://api.github.com/users/kenji0919/events{/privacy}","received_events_url":"https://api.github.com/users/kenji0919/received_events","type":"User","site_admin":false},"body":"オッケーです！\r\n\r\n変えようとは思ってましたが、めんどくさいので放置してました…スミマセン","created_at":"2015-01-27T13:22:30Z","updated_at":"2015-01-27T13:22:30Z","html_url":"https://github.com/kenji0919/pirodx_manager/pull/90#discussion_r23606755","pull_request_url":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/comments/23606755"},"html":{"href":"https://github.com/kenji0919/pirodx_manager/pull/90#discussion_r23606755"},"pull_request":{"href":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/90","id":28107149,"html_url":"https://github.com/kenji0919/pirodx_manager/pull/90","diff_url":"https://github.com/kenji0919/pirodx_manager/pull/90.diff","patch_url":"https://github.com/kenji0919/pirodx_manager/pull/90.patch","issue_url":"https://api.github.com/repos/kenji0919/pirodx_manager/issues/90","number":90,"state":"open","locked":false,"title":"Format code in PirodxEAM.coffee","user":{"login":"suitougreentea","id":1333491,"avatar_url":"https://avatars.githubusercontent.com/u/1333491?v=3","gravatar_id":"","url":"https://api.github.com/users/suitougreentea","html_url":"https://github.com/suitougreentea","followers_url":"https://api.github.com/users/suitougreentea/followers","following_url":"https://api.github.com/users/suitougreentea/following{/other_user}","gists_url":"https://api.github.com/users/suitougreentea/gists{/gist_id}","starred_url":"https://api.github.com/users/suitougreentea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suitougreentea/subscriptions","organizations_url":"https://api.github.com/users/suitougreentea/orgs","repos_url":"https://api.github.com/users/suitougreentea/repos","events_url":"https://api.github.com/users/suitougreentea/events{/privacy}","received_events_url":"https://api.github.com/users/suitougreentea/received_events","type":"User","site_admin":false},"body":"#87","created_at":"2015-01-27T13:12:50Z","updated_at":"2015-01-27T13:22:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99a7a63d3e3dd845c699c05454c578b5ddeee1cf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/90/commits","review_comments_url":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/90/comments","review_comment_url":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/comments/{number}","comments_url":"https://api.github.com/repos/kenji0919/pirodx_manager/issues/90/comments","statuses_url":"https://api.github.com/repos/kenji0919/pirodx_manager/statuses/e6295c551dffeadad77a94ac1deeb383db86c539","head":{"label":"kenji0919:format_code","ref":"format_code","sha":"e6295c551dffeadad77a94ac1deeb383db86c539","user":{"login":"kenji0919","id":2742315,"avatar_url":"https://avatars.githubusercontent.com/u/2742315?v=3","gravatar_id":"","url":"https://api.github.com/users/kenji0919","html_url":"https://github.com/kenji0919","followers_url":"https://api.github.com/users/kenji0919/followers","following_url":"https://api.github.com/users/kenji0919/following{/other_user}","gists_url":"https://api.github.com/users/kenji0919/gists{/gist_id}","starred_url":"https://api.github.com/users/kenji0919/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenji0919/subscriptions","organizations_url":"https://api.github.com/users/kenji0919/orgs","repos_url":"https://api.github.com/users/kenji0919/repos","events_url":"https://api.github.com/users/kenji0919/events{/privacy}","received_events_url":"https://api.github.com/users/kenji0919/received_events","type":"User","site_admin":false},"repo":{"id":28089974,"name":"pirodx_manager","full_name":"kenji0919/pirodx_manager","owner":{"login":"kenji0919","id":2742315,"avatar_url":"https://avatars.githubusercontent.com/u/2742315?v=3","gravatar_id":"","url":"https://api.github.com/users/kenji0919","html_url":"https://github.com/kenji0919","followers_url":"https://api.github.com/users/kenji0919/followers","following_url":"https://api.github.com/users/kenji0919/following{/other_user}","gists_url":"https://api.github.com/users/kenji0919/gists{/gist_id}","starred_url":"https://api.github.com/users/kenji0919/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenji0919/subscriptions","organizations_url":"https://api.github.com/users/kenji0919/orgs","repos_url":"https://api.github.com/users/kenji0919/repos","events_url":"https://api.github.com/users/kenji0919/events{/privacy}","received_events_url":"https://api.github.com/users/kenji0919/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kenji0919/pirodx_manager","description":"Score Manager for beatmania IIDX","fork":false,"url":"https://api.github.com/repos/kenji0919/pirodx_manager","forks_url":"https://api.github.com/repos/kenji0919/pirodx_manager/forks","keys_url":"https://api.github.com/repos/kenji0919/pirodx_manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kenji0919/pirodx_manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kenji0919/pirodx_manager/teams","hooks_url":"https://api.github.com/repos/kenji0919/pirodx_manager/hooks","issue_events_url":"https://api.github.com/repos/kenji0919/pirodx_manager/issues/events{/number}","events_url":"https://api.github.com/repos/kenji0919/pirodx_manager/events","assignees_url":"https://api.github.com/repos/kenji0919/pirodx_manager/assignees{/user}","branches_url":"https://api.github.com/repos/kenji0919/pirodx_manager/branches{/branch}","tags_url":"https://api.github.com/repos/kenji0919/pirodx_manager/tags","blobs_url":"https://api.github.com/repos/kenji0919/pirodx_manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kenji0919/pirodx_manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kenji0919/pirodx_manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/kenji0919/pirodx_manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kenji0919/pirodx_manager/statuses/{sha}","languages_url":"https://api.github.com/repos/kenji0919/pirodx_manager/languages","stargazers_url":"https://api.github.com/repos/kenji0919/pirodx_manager/stargazers","contributors_url":"https://api.github.com/repos/kenji0919/pirodx_manager/contributors","subscribers_url":"https://api.github.com/repos/kenji0919/pirodx_manager/subscribers","subscription_url":"https://api.github.com/repos/kenji0919/pirodx_manager/subscription","commits_url":"https://api.github.com/repos/kenji0919/pirodx_manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/kenji0919/pirodx_manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/kenji0919/pirodx_manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/kenji0919/pirodx_manager/issues/comments/{number}","contents_url":"https://api.github.com/repos/kenji0919/pirodx_manager/contents/{+path}","compare_url":"https://api.github.com/repos/kenji0919/pirodx_manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kenji0919/pirodx_manager/merges","archive_url":"https://api.github.com/repos/kenji0919/pirodx_manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kenji0919/pirodx_manager/downloads","issues_url":"https://api.github.com/repos/kenji0919/pirodx_manager/issues{/number}","pulls_url":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls{/number}","milestones_url":"https://api.github.com/repos/kenji0919/pirodx_manager/milestones{/number}","notifications_url":"https://api.github.com/repos/kenji0919/pirodx_manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kenji0919/pirodx_manager/labels{/name}","releases_url":"https://api.github.com/repos/kenji0919/pirodx_manager/releases{/id}","created_at":"2014-12-16T14:14:58Z","updated_at":"2015-01-27T13:07:46Z","pushed_at":"2015-01-27T13:18:23Z","git_url":"git://github.com/kenji0919/pirodx_manager.git","ssh_url":"git@github.com:kenji0919/pirodx_manager.git","clone_url":"https://github.com/kenji0919/pirodx_manager.git","svn_url":"https://github.com/kenji0919/pirodx_manager","homepage":null,"size":2431,"stargazers_count":3,"watchers_count":3,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":3,"default_branch":"master"}},"base":{"label":"kenji0919:master","ref":"master","sha":"d72b167f064f0d10af90e383e91d8473e2ee0027","user":{"login":"kenji0919","id":2742315,"avatar_url":"https://avatars.githubusercontent.com/u/2742315?v=3","gravatar_id":"","url":"https://api.github.com/users/kenji0919","html_url":"https://github.com/kenji0919","followers_url":"https://api.github.com/users/kenji0919/followers","following_url":"https://api.github.com/users/kenji0919/following{/other_user}","gists_url":"https://api.github.com/users/kenji0919/gists{/gist_id}","starred_url":"https://api.github.com/users/kenji0919/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenji0919/subscriptions","organizations_url":"https://api.github.com/users/kenji0919/orgs","repos_url":"https://api.github.com/users/kenji0919/repos","events_url":"https://api.github.com/users/kenji0919/events{/privacy}","received_events_url":"https://api.github.com/users/kenji0919/received_events","type":"User","site_admin":false},"repo":{"id":28089974,"name":"pirodx_manager","full_name":"kenji0919/pirodx_manager","owner":{"login":"kenji0919","id":2742315,"avatar_url":"https://avatars.githubusercontent.com/u/2742315?v=3","gravatar_id":"","url":"https://api.github.com/users/kenji0919","html_url":"https://github.com/kenji0919","followers_url":"https://api.github.com/users/kenji0919/followers","following_url":"https://api.github.com/users/kenji0919/following{/other_user}","gists_url":"https://api.github.com/users/kenji0919/gists{/gist_id}","starred_url":"https://api.github.com/users/kenji0919/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenji0919/subscriptions","organizations_url":"https://api.github.com/users/kenji0919/orgs","repos_url":"https://api.github.com/users/kenji0919/repos","events_url":"https://api.github.com/users/kenji0919/events{/privacy}","received_events_url":"https://api.github.com/users/kenji0919/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kenji0919/pirodx_manager","description":"Score Manager for beatmania IIDX","fork":false,"url":"https://api.github.com/repos/kenji0919/pirodx_manager","forks_url":"https://api.github.com/repos/kenji0919/pirodx_manager/forks","keys_url":"https://api.github.com/repos/kenji0919/pirodx_manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kenji0919/pirodx_manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kenji0919/pirodx_manager/teams","hooks_url":"https://api.github.com/repos/kenji0919/pirodx_manager/hooks","issue_events_url":"https://api.github.com/repos/kenji0919/pirodx_manager/issues/events{/number}","events_url":"https://api.github.com/repos/kenji0919/pirodx_manager/events","assignees_url":"https://api.github.com/repos/kenji0919/pirodx_manager/assignees{/user}","branches_url":"https://api.github.com/repos/kenji0919/pirodx_manager/branches{/branch}","tags_url":"https://api.github.com/repos/kenji0919/pirodx_manager/tags","blobs_url":"https://api.github.com/repos/kenji0919/pirodx_manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kenji0919/pirodx_manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kenji0919/pirodx_manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/kenji0919/pirodx_manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kenji0919/pirodx_manager/statuses/{sha}","languages_url":"https://api.github.com/repos/kenji0919/pirodx_manager/languages","stargazers_url":"https://api.github.com/repos/kenji0919/pirodx_manager/stargazers","contributors_url":"https://api.github.com/repos/kenji0919/pirodx_manager/contributors","subscribers_url":"https://api.github.com/repos/kenji0919/pirodx_manager/subscribers","subscription_url":"https://api.github.com/repos/kenji0919/pirodx_manager/subscription","commits_url":"https://api.github.com/repos/kenji0919/pirodx_manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/kenji0919/pirodx_manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/kenji0919/pirodx_manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/kenji0919/pirodx_manager/issues/comments/{number}","contents_url":"https://api.github.com/repos/kenji0919/pirodx_manager/contents/{+path}","compare_url":"https://api.github.com/repos/kenji0919/pirodx_manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kenji0919/pirodx_manager/merges","archive_url":"https://api.github.com/repos/kenji0919/pirodx_manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kenji0919/pirodx_manager/downloads","issues_url":"https://api.github.com/repos/kenji0919/pirodx_manager/issues{/number}","pulls_url":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls{/number}","milestones_url":"https://api.github.com/repos/kenji0919/pirodx_manager/milestones{/number}","notifications_url":"https://api.github.com/repos/kenji0919/pirodx_manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kenji0919/pirodx_manager/labels{/name}","releases_url":"https://api.github.com/repos/kenji0919/pirodx_manager/releases{/id}","created_at":"2014-12-16T14:14:58Z","updated_at":"2015-01-27T13:07:46Z","pushed_at":"2015-01-27T13:18:23Z","git_url":"git://github.com/kenji0919/pirodx_manager.git","ssh_url":"git@github.com:kenji0919/pirodx_manager.git","clone_url":"https://github.com/kenji0919/pirodx_manager.git","svn_url":"https://github.com/kenji0919/pirodx_manager","homepage":null,"size":2431,"stargazers_count":3,"watchers_count":3,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/90"},"html":{"href":"https://github.com/kenji0919/pirodx_manager/pull/90"},"issue":{"href":"https://api.github.com/repos/kenji0919/pirodx_manager/issues/90"},"comments":{"href":"https://api.github.com/repos/kenji0919/pirodx_manager/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/kenji0919/pirodx_manager/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/kenji0919/pirodx_manager/statuses/e6295c551dffeadad77a94ac1deeb383db86c539"}}}}