Skip to content
Browse files

implemented playlist-rename

  • Loading branch information...
1 parent c13cb66 commit 978714ea77dc204c1df8751144ac8189e6fb225f @wendlers committed Oct 18, 2012
View
6 doc/PyScMPDImplementation.txt
@@ -66,16 +66,16 @@ prioid No Same as above but ueses ids.
shuffle No Shuffle the current playlist.
swap No Swap two songs.
swapid No As above but ueses ids.
-listplaylist No Lists the songs in the playlist.
+listplaylist Yes Lists the songs in the playlist.
listplaylistinfo Yes Lists the songs with metadata in the playlist.
listplaylists No Prints a list of the playlist directory.
load Yes Loads the playlist into the current queue.
playlistadd No Adds track to a playlist.
playlistclear No Clears a playlist.
playlistdelete No Delete track from playlist.
playlistmove No Move songe in playlist.
-rename No Rename a playlist.
-rm No Remove a playlist.
+rename Yes Rename a playlist.
+rm Yes Remove a playlist.
save Yes Save a playlist.
count No Counts the number of songs and their total playtime in the db.
find No Fins songs in the db.
View
4 extlib/python-mpd-server/mpdserver/command_skel.py
@@ -199,12 +199,16 @@ class Load(Command):
""" Load a playlist in current playlist. Songs are added to
current playlist."""
formatArg=[('playlistName',str)]
+
class Save(Command):
formatArg=[('playlistName',str)]
class Rm(Command):
formatArg=[('playlistName',str)]
+class Rename(Command):
+ formatArg=[('playlistName',str), ('playlistNameNew',str)]
+
class Decoders(CommandItems):
def items(self):
return [('plugin','gstreamer'),
View
1 extlib/python-mpd-server/mpdserver/mpdserver.py
@@ -152,6 +152,7 @@ class MpdRequestHandler(SocketServer.StreamRequestHandler):
'save' :{'class':None,'users':[],'group':'write','mpdVersion':"0.12",'neededBy':None},
'search' :{'class':None,'users':[],'group':'read','mpdVersion':"0.12",'neededBy':None},
'rm' :{'class':None,'users':[],'group':'write','mpdVersion':"0.12",'neededBy':None},
+ 'rename' :{'class':None,'users':[],'group':'write','mpdVersion':"0.12",'neededBy':None},
'setvol' :{'class':None,'users':[],'group':'control','mpdVersion':"0.12",'neededBy':None},
'decoders' :{'class':Decoders,'users':['default'],'group':'reflection','mpdVersion':"0.12",'neededBy':None}
}
View
9 src/pyscmpd/scmpd.py
@@ -66,6 +66,7 @@ def __init__(self, favoriteUsers, favoriteGroups, favoriteFavorites, serverPort
self.requestHandler.RegisterCommand(ListPlaylistInfo)
self.requestHandler.RegisterCommand(ListPlaylists)
self.requestHandler.RegisterCommand(Rm)
+ self.requestHandler.RegisterCommand(Rename)
self.requestHandler.Playlist = MpdPlaylist
@@ -249,6 +250,14 @@ def handle_args(self, playlistName):
ScMpdServerDaemon.player.removePlaylist(playlistName)
+class Rename(mpdserver.Rename):
+
+ def handle_args(self, playlistName, playlistNameNew):
+
+ logging.info("Renaming playlist: %s to %s" % (playlistName, playlistNameNew))
+
+ ScMpdServerDaemon.player.renamePlaylist(playlistName, playlistNameNew)
+
class Add(mpdserver.Add):
def handle_args(self, song):

0 comments on commit 978714e

Please sign in to comment.
Something went wrong with that request. Please try again.