From 18a2d1770b47160a3aa8848fa5dacffc2a2effcb Mon Sep 17 00:00:00 2001 From: Thomas Refis Date: Tue, 9 Apr 2013 19:25:10 +0200 Subject: [PATCH] mpd: bugfix in MpdContext.create_unique_name --- mopidy/frontends/mpd/dispatcher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mopidy/frontends/mpd/dispatcher.py b/mopidy/frontends/mpd/dispatcher.py index ed2c82a1..0054a6f1 100644 --- a/mopidy/frontends/mpd/dispatcher.py +++ b/mopidy/frontends/mpd/dispatcher.py @@ -246,10 +246,11 @@ class MpdContext(object): self.playlist_name_from_uri = {} self.refresh_playlists_mapping() - def create_unique_name(self, name): + def create_unique_name(self, playlist_name): + name = playlist_name i = 1 while name in self.playlist_uri_from_name: - name = '%s [%d]' % playlist.name % i + name = '%s [%d]' % (playlist_name, i) i += 1 return name