From f90bfeffe79ab1001101ad0ef7b91e00c85071a1 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 May 2010 02:40:52 -0400 Subject: [PATCH] Fix broken hooke.plugin.playlist.playlist_name_callback --- hooke/plugin/playlist.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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, -- 2.26.2