{"action":"created","comment":{"url":"https://api.github.com/repos/mopidy/mopidy/pulls/comments/30842448","id":30842448,"diff_hunk":"@@ -157,7 +166,15 @@ def playlistclear(context, name):\n \n         Clears the playlist ``NAME.m3u``.\n     \"\"\"\n-    raise exceptions.MpdNotImplemented  # TODO\n+    uri = context.lookup_playlist_uri_from_name(name)\n+    playlist = uri is not None and context.core.playlists.lookup(uri).get()\n+    if not playlist:\n+        playlist = context.core.playlists.create(name).get()\n+\n+    # Just replace tracks with empty list and save\n+    playlist = playlist.replace(tracks=[])\n+    context.core.playlists.save(playlist).get()\n+    return","path":"mopidy/mpd/protocol/stored_playlists.py","position":40,"original_position":40,"commit_id":"6b367a9f5c756eccaf03ce8dc6d62dc691d0432a","original_commit_id":"6b367a9f5c756eccaf03ce8dc6d62dc691d0432a","user":{"login":"adamcik","id":82534,"avatar_url":"https://avatars.githubusercontent.com/u/82534?v=3","gravatar_id":"","url":"https://api.github.com/users/adamcik","html_url":"https://github.com/adamcik","followers_url":"https://api.github.com/users/adamcik/followers","following_url":"https://api.github.com/users/adamcik/following{/other_user}","gists_url":"https://api.github.com/users/adamcik/gists{/gist_id}","starred_url":"https://api.github.com/users/adamcik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamcik/subscriptions","organizations_url":"https://api.github.com/users/adamcik/orgs","repos_url":"https://api.github.com/users/adamcik/repos","events_url":"https://api.github.com/users/adamcik/events{/privacy}","received_events_url":"https://api.github.com/users/adamcik/received_events","type":"User","site_admin":false},"body":"No need for explicit empty returns.","created_at":"2015-05-21T20:14:44Z","updated_at":"2015-05-21T20:14:44Z","html_url":"https://github.com/mopidy/mopidy/pull/1187#discussion_r30842448","pull_request_url":"https://api.github.com/repos/mopidy/mopidy/pulls/1187","_links":{"self":{"href":"https://api.github.com/repos/mopidy/mopidy/pulls/comments/30842448"},"html":{"href":"https://github.com/mopidy/mopidy/pull/1187#discussion_r30842448"},"pull_request":{"href":"https://api.github.com/repos/mopidy/mopidy/pulls/1187"}}},"pull_request":{"url":"https://api.github.com/repos/mopidy/mopidy/pulls/1187","id":35886204,"html_url":"https://github.com/mopidy/mopidy/pull/1187","diff_url":"https://github.com/mopidy/mopidy/pull/1187.diff","patch_url":"https://github.com/mopidy/mopidy/pull/1187.patch","issue_url":"https://api.github.com/repos/mopidy/mopidy/issues/1187","number":1187,"state":"open","locked":false,"title":"mpd: Implemetation for commands related to modifying stored playlists.","user":{"login":"kozec","id":1282500,"avatar_url":"https://avatars.githubusercontent.com/u/1282500?v=3","gravatar_id":"","url":"https://api.github.com/users/kozec","html_url":"https://github.com/kozec","followers_url":"https://api.github.com/users/kozec/followers","following_url":"https://api.github.com/users/kozec/following{/other_user}","gists_url":"https://api.github.com/users/kozec/gists{/gist_id}","starred_url":"https://api.github.com/users/kozec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kozec/subscriptions","organizations_url":"https://api.github.com/users/kozec/orgs","repos_url":"https://api.github.com/users/kozec/repos","events_url":"https://api.github.com/users/kozec/events{/privacy}","received_events_url":"https://api.github.com/users/kozec/received_events","type":"User","site_admin":false},"body":"This PR implements all missing commands from `mpd/protocol/stored_playlists.py`. It turned out to be rather simple, so I just hope I didn't overlooked anything big.\r\n\r\nMain problem can be in fe8bb5114e9969f328e66f9d3be722f523ae51f3. Event on delete is important for MPD clients, but if anything else relies on playlist to be valid object instead of None, this change may break it.\r\n\r\nI've tested implementation with GMPC, Cantana and MPDroid.","created_at":"2015-05-20T23:19:02Z","updated_at":"2015-05-21T20:14:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a7837455327253aa9f612ec30f0f3a1695c1c2b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mopidy/mopidy/pulls/1187/commits","review_comments_url":"https://api.github.com/repos/mopidy/mopidy/pulls/1187/comments","review_comment_url":"https://api.github.com/repos/mopidy/mopidy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mopidy/mopidy/issues/1187/comments","statuses_url":"https://api.github.com/repos/mopidy/mopidy/statuses/6b367a9f5c756eccaf03ce8dc6d62dc691d0432a","head":{"label":"kozec:missing-mpd-commands","ref":"missing-mpd-commands","sha":"6b367a9f5c756eccaf03ce8dc6d62dc691d0432a","user":{"login":"kozec","id":1282500,"avatar_url":"https://avatars.githubusercontent.com/u/1282500?v=3","gravatar_id":"","url":"https://api.github.com/users/kozec","html_url":"https://github.com/kozec","followers_url":"https://api.github.com/users/kozec/followers","following_url":"https://api.github.com/users/kozec/following{/other_user}","gists_url":"https://api.github.com/users/kozec/gists{/gist_id}","starred_url":"https://api.github.com/users/kozec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kozec/subscriptions","organizations_url":"https://api.github.com/users/kozec/orgs","repos_url":"https://api.github.com/users/kozec/repos","events_url":"https://api.github.com/users/kozec/events{/privacy}","received_events_url":"https://api.github.com/users/kozec/received_events","type":"User","site_admin":false},"repo":{"id":35970065,"name":"mopidy","full_name":"kozec/mopidy","owner":{"login":"kozec","id":1282500,"avatar_url":"https://avatars.githubusercontent.com/u/1282500?v=3","gravatar_id":"","url":"https://api.github.com/users/kozec","html_url":"https://github.com/kozec","followers_url":"https://api.github.com/users/kozec/followers","following_url":"https://api.github.com/users/kozec/following{/other_user}","gists_url":"https://api.github.com/users/kozec/gists{/gist_id}","starred_url":"https://api.github.com/users/kozec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kozec/subscriptions","organizations_url":"https://api.github.com/users/kozec/orgs","repos_url":"https://api.github.com/users/kozec/repos","events_url":"https://api.github.com/users/kozec/events{/privacy}","received_events_url":"https://api.github.com/users/kozec/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kozec/mopidy","description":"Mopidy is an extensible music server that plays music from local disk, Spotify, SoundCloud, Google Play Music, and more. You edit the playlist from any phone, tablet, or computer using a range of MPD and web clients.","fork":true,"url":"https://api.github.com/repos/kozec/mopidy","forks_url":"https://api.github.com/repos/kozec/mopidy/forks","keys_url":"https://api.github.com/repos/kozec/mopidy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kozec/mopidy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kozec/mopidy/teams","hooks_url":"https://api.github.com/repos/kozec/mopidy/hooks","issue_events_url":"https://api.github.com/repos/kozec/mopidy/issues/events{/number}","events_url":"https://api.github.com/repos/kozec/mopidy/events","assignees_url":"https://api.github.com/repos/kozec/mopidy/assignees{/user}","branches_url":"https://api.github.com/repos/kozec/mopidy/branches{/branch}","tags_url":"https://api.github.com/repos/kozec/mopidy/tags","blobs_url":"https://api.github.com/repos/kozec/mopidy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kozec/mopidy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kozec/mopidy/git/refs{/sha}","trees_url":"https://api.github.com/repos/kozec/mopidy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kozec/mopidy/statuses/{sha}","languages_url":"https://api.github.com/repos/kozec/mopidy/languages","stargazers_url":"https://api.github.com/repos/kozec/mopidy/stargazers","contributors_url":"https://api.github.com/repos/kozec/mopidy/contributors","subscribers_url":"https://api.github.com/repos/kozec/mopidy/subscribers","subscription_url":"https://api.github.com/repos/kozec/mopidy/subscription","commits_url":"https://api.github.com/repos/kozec/mopidy/commits{/sha}","git_commits_url":"https://api.github.com/repos/kozec/mopidy/git/commits{/sha}","comments_url":"https://api.github.com/repos/kozec/mopidy/comments{/number}","issue_comment_url":"https://api.github.com/repos/kozec/mopidy/issues/comments{/number}","contents_url":"https://api.github.com/repos/kozec/mopidy/contents/{+path}","compare_url":"https://api.github.com/repos/kozec/mopidy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kozec/mopidy/merges","archive_url":"https://api.github.com/repos/kozec/mopidy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kozec/mopidy/downloads","issues_url":"https://api.github.com/repos/kozec/mopidy/issues{/number}","pulls_url":"https://api.github.com/repos/kozec/mopidy/pulls{/number}","milestones_url":"https://api.github.com/repos/kozec/mopidy/milestones{/number}","notifications_url":"https://api.github.com/repos/kozec/mopidy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kozec/mopidy/labels{/name}","releases_url":"https://api.github.com/repos/kozec/mopidy/releases{/id}","created_at":"2015-05-20T19:38:31Z","updated_at":"2015-05-20T19:38:32Z","pushed_at":"2015-05-21T18:53:57Z","git_url":"git://github.com/kozec/mopidy.git","ssh_url":"git@github.com:kozec/mopidy.git","clone_url":"https://github.com/kozec/mopidy.git","svn_url":"https://github.com/kozec/mopidy","homepage":"www.mopidy.com","size":27790,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"develop"}},"base":{"label":"mopidy:develop","ref":"develop","sha":"10b0796bbdf8e79e70be3b343c4f083ec4a6bf89","user":{"login":"mopidy","id":451998,"avatar_url":"https://avatars.githubusercontent.com/u/451998?v=3","gravatar_id":"","url":"https://api.github.com/users/mopidy","html_url":"https://github.com/mopidy","followers_url":"https://api.github.com/users/mopidy/followers","following_url":"https://api.github.com/users/mopidy/following{/other_user}","gists_url":"https://api.github.com/users/mopidy/gists{/gist_id}","starred_url":"https://api.github.com/users/mopidy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mopidy/subscriptions","organizations_url":"https://api.github.com/users/mopidy/orgs","repos_url":"https://api.github.com/users/mopidy/repos","events_url":"https://api.github.com/users/mopidy/events{/privacy}","received_events_url":"https://api.github.com/users/mopidy/received_events","type":"Organization","site_admin":false},"repo":{"id":447036,"name":"mopidy","full_name":"mopidy/mopidy","owner":{"login":"mopidy","id":451998,"avatar_url":"https://avatars.githubusercontent.com/u/451998?v=3","gravatar_id":"","url":"https://api.github.com/users/mopidy","html_url":"https://github.com/mopidy","followers_url":"https://api.github.com/users/mopidy/followers","following_url":"https://api.github.com/users/mopidy/following{/other_user}","gists_url":"https://api.github.com/users/mopidy/gists{/gist_id}","starred_url":"https://api.github.com/users/mopidy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mopidy/subscriptions","organizations_url":"https://api.github.com/users/mopidy/orgs","repos_url":"https://api.github.com/users/mopidy/repos","events_url":"https://api.github.com/users/mopidy/events{/privacy}","received_events_url":"https://api.github.com/users/mopidy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mopidy/mopidy","description":"Mopidy is an extensible music server that plays music from local disk, Spotify, SoundCloud, Google Play Music, and more. You edit the playlist from any phone, tablet, or computer using a range of MPD and web clients.","fork":false,"url":"https://api.github.com/repos/mopidy/mopidy","forks_url":"https://api.github.com/repos/mopidy/mopidy/forks","keys_url":"https://api.github.com/repos/mopidy/mopidy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mopidy/mopidy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mopidy/mopidy/teams","hooks_url":"https://api.github.com/repos/mopidy/mopidy/hooks","issue_events_url":"https://api.github.com/repos/mopidy/mopidy/issues/events{/number}","events_url":"https://api.github.com/repos/mopidy/mopidy/events","assignees_url":"https://api.github.com/repos/mopidy/mopidy/assignees{/user}","branches_url":"https://api.github.com/repos/mopidy/mopidy/branches{/branch}","tags_url":"https://api.github.com/repos/mopidy/mopidy/tags","blobs_url":"https://api.github.com/repos/mopidy/mopidy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mopidy/mopidy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mopidy/mopidy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mopidy/mopidy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mopidy/mopidy/statuses/{sha}","languages_url":"https://api.github.com/repos/mopidy/mopidy/languages","stargazers_url":"https://api.github.com/repos/mopidy/mopidy/stargazers","contributors_url":"https://api.github.com/repos/mopidy/mopidy/contributors","subscribers_url":"https://api.github.com/repos/mopidy/mopidy/subscribers","subscription_url":"https://api.github.com/repos/mopidy/mopidy/subscription","commits_url":"https://api.github.com/repos/mopidy/mopidy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mopidy/mopidy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mopidy/mopidy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mopidy/mopidy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mopidy/mopidy/contents/{+path}","compare_url":"https://api.github.com/repos/mopidy/mopidy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mopidy/mopidy/merges","archive_url":"https://api.github.com/repos/mopidy/mopidy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mopidy/mopidy/downloads","issues_url":"https://api.github.com/repos/mopidy/mopidy/issues{/number}","pulls_url":"https://api.github.com/repos/mopidy/mopidy/pulls{/number}","milestones_url":"https://api.github.com/repos/mopidy/mopidy/milestones{/number}","notifications_url":"https://api.github.com/repos/mopidy/mopidy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mopidy/mopidy/labels{/name}","releases_url":"https://api.github.com/repos/mopidy/mopidy/releases{/id}","created_at":"2009-12-23T14:25:36Z","updated_at":"2015-05-21T18:26:44Z","pushed_at":"2015-05-21T18:53:57Z","git_url":"git://github.com/mopidy/mopidy.git","ssh_url":"git@github.com:mopidy/mopidy.git","clone_url":"https://github.com/mopidy/mopidy.git","svn_url":"https://github.com/mopidy/mopidy","homepage":"www.mopidy.com","size":27790,"stargazers_count":1955,"watchers_count":1955,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":232,"mirror_url":null,"open_issues_count":146,"forks":232,"open_issues":146,"watchers":1955,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mopidy/mopidy/pulls/1187"},"html":{"href":"https://github.com/mopidy/mopidy/pull/1187"},"issue":{"href":"https://api.github.com/repos/mopidy/mopidy/issues/1187"},"comments":{"href":"https://api.github.com/repos/mopidy/mopidy/issues/1187/comments"},"review_comments":{"href":"https://api.github.com/repos/mopidy/mopidy/pulls/1187/comments"},"review_comment":{"href":"https://api.github.com/repos/mopidy/mopidy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mopidy/mopidy/pulls/1187/commits"},"statuses":{"href":"https://api.github.com/repos/mopidy/mopidy/statuses/6b367a9f5c756eccaf03ce8dc6d62dc691d0432a"}}}}