From: W. Trevor King Date: Wed, 19 May 2010 06:40:52 +0000 (-0400) Subject: Fix broken hooke.plugin.playlist.playlist_name_callback X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f90bfeffe79ab1001101ad0ef7b91e00c85071a1;p=hooke.git Fix broken hooke.plugin.playlist.playlist_name_callback --- diff --git a/hooke/plugin/playlist.py b/hooke/plugin/playlist.py index dd6e626..980123c 100644 --- a/hooke/plugin/playlist.py +++ b/hooke/plugin/playlist.py @@ -57,7 +57,13 @@ playlist. """.strip()) def playlist_name_callback(hooke, command, argument, value): - return hooke.playlists.free_name() + i = 0 + names = [p.name for p in hooke.playlists] + while True: + name = 'playlist-%d' % i + if name not in names: + return name + i += 1 PlaylistNameArgument = Argument( name='name', type='string', optional=True, callback=playlist_name_callback,