{"action":"created","comment":{"url":"https://api.github.com/repos/jbodah/spotifuby/pulls/comments/36230081","id":36230081,"diff_hunk":"@@ -18,27 +19,54 @@ def tracks_on_album(album)\n       cast RSpotify::Album.find(album).tracks\n     end\n \n-    def who_added_track(user, playlist_uri, track_uri)\n-      track_id = track_uri.sub('spotify:track:', '')\n-      playlist_id = playlist_uri.sub(\"spotify:user:#{user}:playlist:\", '')\n-      all_songs = {}\n+    #def who_added_track(user, playlist_id, track_id)\n+      #all_songs = {}\n \n-      playlist = RSpotify::Playlist.find(user, playlist_id)\n-      current_offset = 0\n+      #playlist = RSpotify::Playlist.find(user, playlist_id)\n+      #current_offset = 0\n \n-      tracks = playlist.tracks(offset: current_offset)\n-      all_songs.merge!(playlist.tracks_added_by)\n-      while tracks.count > 0 do\n-        current_offset += 100\n-        tracks = playlist.tracks(offset: current_offset)\n-        all_songs.merge!(playlist.tracks_added_by)\n+      #tracks = playlist.tracks(offset: current_offset)\n+      #all_songs.merge!(playlist.tracks_added_by)\n+      #while tracks.count > 0 do\n+        #current_offset += 100\n+        #tracks = playlist.tracks(offset: current_offset)\n+        #all_songs.merge!(playlist.tracks_added_by)\n+      #end\n+\n+      #{ name: all_songs[track_id].id }\n+    #end\n+\n+    def who_added_track(playlist_uri, track_id)\n+      added_by = playlist_tracks_by_added_by(playlist_uri).find do |t_id, added_by|\n+        t_id == track_id\n       end\n \n-      { name: all_songs[track_id].id }\n+      # TODO - make a type for this\n+      { name: added_by.id }\n     end\n \n     private\n \n+    # TODO - what does this yield","path":"lib/spotify/web.rb","position":53,"original_position":53,"commit_id":"800d44c68e26544901e022b70caf5df6db5b4a18","original_commit_id":"800d44c68e26544901e022b70caf5df6db5b4a18","user":{"login":"jbodah","id":6093002,"avatar_url":"https://avatars.githubusercontent.com/u/6093002?v=3","gravatar_id":"","url":"https://api.github.com/users/jbodah","html_url":"https://github.com/jbodah","followers_url":"https://api.github.com/users/jbodah/followers","following_url":"https://api.github.com/users/jbodah/following{/other_user}","gists_url":"https://api.github.com/users/jbodah/gists{/gist_id}","starred_url":"https://api.github.com/users/jbodah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbodah/subscriptions","organizations_url":"https://api.github.com/users/jbodah/orgs","repos_url":"https://api.github.com/users/jbodah/repos","events_url":"https://api.github.com/users/jbodah/events{/privacy}","received_events_url":"https://api.github.com/users/jbodah/received_events","type":"User","site_admin":false},"body":"RSpotify::User","created_at":"2015-08-04T19:20:31Z","updated_at":"2015-08-04T19:20:31Z","html_url":"https://github.com/jbodah/spotifuby/pull/30#discussion_r36230081","pull_request_url":"https://api.github.com/repos/jbodah/spotifuby/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/jbodah/spotifuby/pulls/comments/36230081"},"html":{"href":"https://github.com/jbodah/spotifuby/pull/30#discussion_r36230081"},"pull_request":{"href":"https://api.github.com/repos/jbodah/spotifuby/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/jbodah/spotifuby/pulls/30","id":41600938,"html_url":"https://github.com/jbodah/spotifuby/pull/30","diff_url":"https://github.com/jbodah/spotifuby/pull/30.diff","patch_url":"https://github.com/jbodah/spotifuby/pull/30.patch","issue_url":"https://api.github.com/repos/jbodah/spotifuby/issues/30","number":30,"state":"open","locked":false,"title":"refactor who_added_track","user":{"login":"jbodah","id":6093002,"avatar_url":"https://avatars.githubusercontent.com/u/6093002?v=3","gravatar_id":"","url":"https://api.github.com/users/jbodah","html_url":"https://github.com/jbodah","followers_url":"https://api.github.com/users/jbodah/followers","following_url":"https://api.github.com/users/jbodah/following{/other_user}","gists_url":"https://api.github.com/users/jbodah/gists{/gist_id}","starred_url":"https://api.github.com/users/jbodah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbodah/subscriptions","organizations_url":"https://api.github.com/users/jbodah/orgs","repos_url":"https://api.github.com/users/jbodah/repos","events_url":"https://api.github.com/users/jbodah/events{/privacy}","received_events_url":"https://api.github.com/users/jbodah/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-04T18:24:07Z","updated_at":"2015-08-04T19:20:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f62a7a444fd778fff31d8cf1d74e76f2bb5fd77","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jbodah/spotifuby/pulls/30/commits","review_comments_url":"https://api.github.com/repos/jbodah/spotifuby/pulls/30/comments","review_comment_url":"https://api.github.com/repos/jbodah/spotifuby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jbodah/spotifuby/issues/30/comments","statuses_url":"https://api.github.com/repos/jbodah/spotifuby/statuses/800d44c68e26544901e022b70caf5df6db5b4a18","head":{"label":"jbodah:refactor","ref":"refactor","sha":"800d44c68e26544901e022b70caf5df6db5b4a18","user":{"login":"jbodah","id":6093002,"avatar_url":"https://avatars.githubusercontent.com/u/6093002?v=3","gravatar_id":"","url":"https://api.github.com/users/jbodah","html_url":"https://github.com/jbodah","followers_url":"https://api.github.com/users/jbodah/followers","following_url":"https://api.github.com/users/jbodah/following{/other_user}","gists_url":"https://api.github.com/users/jbodah/gists{/gist_id}","starred_url":"https://api.github.com/users/jbodah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbodah/subscriptions","organizations_url":"https://api.github.com/users/jbodah/orgs","repos_url":"https://api.github.com/users/jbodah/repos","events_url":"https://api.github.com/users/jbodah/events{/privacy}","received_events_url":"https://api.github.com/users/jbodah/received_events","type":"User","site_admin":false},"repo":{"id":31337405,"name":"spotifuby","full_name":"jbodah/spotifuby","owner":{"login":"jbodah","id":6093002,"avatar_url":"https://avatars.githubusercontent.com/u/6093002?v=3","gravatar_id":"","url":"https://api.github.com/users/jbodah","html_url":"https://github.com/jbodah","followers_url":"https://api.github.com/users/jbodah/followers","following_url":"https://api.github.com/users/jbodah/following{/other_user}","gists_url":"https://api.github.com/users/jbodah/gists{/gist_id}","starred_url":"https://api.github.com/users/jbodah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbodah/subscriptions","organizations_url":"https://api.github.com/users/jbodah/orgs","repos_url":"https://api.github.com/users/jbodah/repos","events_url":"https://api.github.com/users/jbodah/events{/privacy}","received_events_url":"https://api.github.com/users/jbodah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jbodah/spotifuby","description":"Ruby server for interacting with Spotify on OSX","fork":false,"url":"https://api.github.com/repos/jbodah/spotifuby","forks_url":"https://api.github.com/repos/jbodah/spotifuby/forks","keys_url":"https://api.github.com/repos/jbodah/spotifuby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbodah/spotifuby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbodah/spotifuby/teams","hooks_url":"https://api.github.com/repos/jbodah/spotifuby/hooks","issue_events_url":"https://api.github.com/repos/jbodah/spotifuby/issues/events{/number}","events_url":"https://api.github.com/repos/jbodah/spotifuby/events","assignees_url":"https://api.github.com/repos/jbodah/spotifuby/assignees{/user}","branches_url":"https://api.github.com/repos/jbodah/spotifuby/branches{/branch}","tags_url":"https://api.github.com/repos/jbodah/spotifuby/tags","blobs_url":"https://api.github.com/repos/jbodah/spotifuby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbodah/spotifuby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbodah/spotifuby/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbodah/spotifuby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbodah/spotifuby/statuses/{sha}","languages_url":"https://api.github.com/repos/jbodah/spotifuby/languages","stargazers_url":"https://api.github.com/repos/jbodah/spotifuby/stargazers","contributors_url":"https://api.github.com/repos/jbodah/spotifuby/contributors","subscribers_url":"https://api.github.com/repos/jbodah/spotifuby/subscribers","subscription_url":"https://api.github.com/repos/jbodah/spotifuby/subscription","commits_url":"https://api.github.com/repos/jbodah/spotifuby/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbodah/spotifuby/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbodah/spotifuby/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbodah/spotifuby/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbodah/spotifuby/contents/{+path}","compare_url":"https://api.github.com/repos/jbodah/spotifuby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbodah/spotifuby/merges","archive_url":"https://api.github.com/repos/jbodah/spotifuby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbodah/spotifuby/downloads","issues_url":"https://api.github.com/repos/jbodah/spotifuby/issues{/number}","pulls_url":"https://api.github.com/repos/jbodah/spotifuby/pulls{/number}","milestones_url":"https://api.github.com/repos/jbodah/spotifuby/milestones{/number}","notifications_url":"https://api.github.com/repos/jbodah/spotifuby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbodah/spotifuby/labels{/name}","releases_url":"https://api.github.com/repos/jbodah/spotifuby/releases{/id}","created_at":"2015-02-25T21:46:53Z","updated_at":"2015-06-17T00:59:56Z","pushed_at":"2015-08-04T18:25:57Z","git_url":"git://github.com/jbodah/spotifuby.git","ssh_url":"git@github.com:jbodah/spotifuby.git","clone_url":"https://github.com/jbodah/spotifuby.git","svn_url":"https://github.com/jbodah/spotifuby","homepage":null,"size":321,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":1,"default_branch":"master"}},"base":{"label":"jbodah:master","ref":"master","sha":"49b5fc50342ab6eedf98011d7053cf434ba2b074","user":{"login":"jbodah","id":6093002,"avatar_url":"https://avatars.githubusercontent.com/u/6093002?v=3","gravatar_id":"","url":"https://api.github.com/users/jbodah","html_url":"https://github.com/jbodah","followers_url":"https://api.github.com/users/jbodah/followers","following_url":"https://api.github.com/users/jbodah/following{/other_user}","gists_url":"https://api.github.com/users/jbodah/gists{/gist_id}","starred_url":"https://api.github.com/users/jbodah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbodah/subscriptions","organizations_url":"https://api.github.com/users/jbodah/orgs","repos_url":"https://api.github.com/users/jbodah/repos","events_url":"https://api.github.com/users/jbodah/events{/privacy}","received_events_url":"https://api.github.com/users/jbodah/received_events","type":"User","site_admin":false},"repo":{"id":31337405,"name":"spotifuby","full_name":"jbodah/spotifuby","owner":{"login":"jbodah","id":6093002,"avatar_url":"https://avatars.githubusercontent.com/u/6093002?v=3","gravatar_id":"","url":"https://api.github.com/users/jbodah","html_url":"https://github.com/jbodah","followers_url":"https://api.github.com/users/jbodah/followers","following_url":"https://api.github.com/users/jbodah/following{/other_user}","gists_url":"https://api.github.com/users/jbodah/gists{/gist_id}","starred_url":"https://api.github.com/users/jbodah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbodah/subscriptions","organizations_url":"https://api.github.com/users/jbodah/orgs","repos_url":"https://api.github.com/users/jbodah/repos","events_url":"https://api.github.com/users/jbodah/events{/privacy}","received_events_url":"https://api.github.com/users/jbodah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jbodah/spotifuby","description":"Ruby server for interacting with Spotify on OSX","fork":false,"url":"https://api.github.com/repos/jbodah/spotifuby","forks_url":"https://api.github.com/repos/jbodah/spotifuby/forks","keys_url":"https://api.github.com/repos/jbodah/spotifuby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbodah/spotifuby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbodah/spotifuby/teams","hooks_url":"https://api.github.com/repos/jbodah/spotifuby/hooks","issue_events_url":"https://api.github.com/repos/jbodah/spotifuby/issues/events{/number}","events_url":"https://api.github.com/repos/jbodah/spotifuby/events","assignees_url":"https://api.github.com/repos/jbodah/spotifuby/assignees{/user}","branches_url":"https://api.github.com/repos/jbodah/spotifuby/branches{/branch}","tags_url":"https://api.github.com/repos/jbodah/spotifuby/tags","blobs_url":"https://api.github.com/repos/jbodah/spotifuby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbodah/spotifuby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbodah/spotifuby/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbodah/spotifuby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbodah/spotifuby/statuses/{sha}","languages_url":"https://api.github.com/repos/jbodah/spotifuby/languages","stargazers_url":"https://api.github.com/repos/jbodah/spotifuby/stargazers","contributors_url":"https://api.github.com/repos/jbodah/spotifuby/contributors","subscribers_url":"https://api.github.com/repos/jbodah/spotifuby/subscribers","subscription_url":"https://api.github.com/repos/jbodah/spotifuby/subscription","commits_url":"https://api.github.com/repos/jbodah/spotifuby/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbodah/spotifuby/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbodah/spotifuby/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbodah/spotifuby/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbodah/spotifuby/contents/{+path}","compare_url":"https://api.github.com/repos/jbodah/spotifuby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbodah/spotifuby/merges","archive_url":"https://api.github.com/repos/jbodah/spotifuby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbodah/spotifuby/downloads","issues_url":"https://api.github.com/repos/jbodah/spotifuby/issues{/number}","pulls_url":"https://api.github.com/repos/jbodah/spotifuby/pulls{/number}","milestones_url":"https://api.github.com/repos/jbodah/spotifuby/milestones{/number}","notifications_url":"https://api.github.com/repos/jbodah/spotifuby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbodah/spotifuby/labels{/name}","releases_url":"https://api.github.com/repos/jbodah/spotifuby/releases{/id}","created_at":"2015-02-25T21:46:53Z","updated_at":"2015-06-17T00:59:56Z","pushed_at":"2015-08-04T18:25:57Z","git_url":"git://github.com/jbodah/spotifuby.git","ssh_url":"git@github.com:jbodah/spotifuby.git","clone_url":"https://github.com/jbodah/spotifuby.git","svn_url":"https://github.com/jbodah/spotifuby","homepage":null,"size":321,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jbodah/spotifuby/pulls/30"},"html":{"href":"https://github.com/jbodah/spotifuby/pull/30"},"issue":{"href":"https://api.github.com/repos/jbodah/spotifuby/issues/30"},"comments":{"href":"https://api.github.com/repos/jbodah/spotifuby/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/jbodah/spotifuby/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/jbodah/spotifuby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jbodah/spotifuby/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/jbodah/spotifuby/statuses/800d44c68e26544901e022b70caf5df6db5b4a18"}}}}