{"action":"created","issue":{"url":"https://api.github.com/repos/pahgawk/Pluto/issues/28","labels_url":"https://api.github.com/repos/pahgawk/Pluto/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/pahgawk/Pluto/issues/28/comments","events_url":"https://api.github.com/repos/pahgawk/Pluto/issues/28/events","html_url":"https://github.com/pahgawk/Pluto/pull/28","id":103869052,"number":28,"title":"Make sure Muzik grabs songs correctly and sends error responses","user":{"login":"pahgawk","id":5315059,"avatar_url":"https://avatars.githubusercontent.com/u/5315059?v=3","gravatar_id":"","url":"https://api.github.com/users/pahgawk","html_url":"https://github.com/pahgawk","followers_url":"https://api.github.com/users/pahgawk/followers","following_url":"https://api.github.com/users/pahgawk/following{/other_user}","gists_url":"https://api.github.com/users/pahgawk/gists{/gist_id}","starred_url":"https://api.github.com/users/pahgawk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pahgawk/subscriptions","organizations_url":"https://api.github.com/users/pahgawk/orgs","repos_url":"https://api.github.com/users/pahgawk/repos","events_url":"https://api.github.com/users/pahgawk/events{/privacy}","received_events_url":"https://api.github.com/users/pahgawk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-29T18:41:30Z","updated_at":"2015-08-29T22:42:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pahgawk/Pluto/pulls/28","html_url":"https://github.com/pahgawk/Pluto/pull/28","diff_url":"https://github.com/pahgawk/Pluto/pull/28.diff","patch_url":"https://github.com/pahgawk/Pluto/pull/28.patch"},"body":"This introduces error handling into the Muzik driver so that when there are no good responses, instead of silently dying, we get results:\r\n\r\n![muzikerrors](https://cloud.githubusercontent.com/assets/5315059/9563725/b3f67252-4e5b-11e5-805c-59610a15ea60.gif)\r\n\r\nChanges made so that this can happen:\r\n- Muzik is now a normal Pluto module so that requests can be mocked and tested\r\n- Muzik has an array of possible song title formats that are good so that it can better prioritize results\r\n- Instead of directly calling a `getLinks` function, emit a `muzik::get_link` event with the song, ignore list, and callback function\r\n- The Muzik callback function now has the arguments `err, url` instead of `name, url`. We weren't using the song name from here anyway, we only use it internally for sorting results.\r\n\r\nTODO:\r\n- [ ] Disable play/pause button until the song can actually play\r\n- [ ] Show how many links have been tried so you can see some feedback\r\n- [ ] Cache hits to Muzik so it doesn't have to do another HTTP request just to try the next song\r\n\r\nThis addresses https://github.com/pahgawk/Pluto/issues/23.\r\n\r\n/cc @andrew749 "},"comment":{"url":"https://api.github.com/repos/pahgawk/Pluto/issues/comments/136058562","html_url":"https://github.com/pahgawk/Pluto/pull/28#issuecomment-136058562","issue_url":"https://api.github.com/repos/pahgawk/Pluto/issues/28","id":136058562,"user":{"login":"andrew749","id":2242730,"avatar_url":"https://avatars.githubusercontent.com/u/2242730?v=3","gravatar_id":"","url":"https://api.github.com/users/andrew749","html_url":"https://github.com/andrew749","followers_url":"https://api.github.com/users/andrew749/followers","following_url":"https://api.github.com/users/andrew749/following{/other_user}","gists_url":"https://api.github.com/users/andrew749/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew749/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew749/subscriptions","organizations_url":"https://api.github.com/users/andrew749/orgs","repos_url":"https://api.github.com/users/andrew749/repos","events_url":"https://api.github.com/users/andrew749/events{/privacy}","received_events_url":"https://api.github.com/users/andrew749/received_events","type":"User","site_admin":false},"created_at":"2015-08-29T22:42:05Z","updated_at":"2015-08-29T22:42:05Z","body":"What do you mean by if there are no good results, then it will get results? Im kinda confused."}}