diff options
Diffstat (limited to 'nephilim/mpclient.py')
-rw-r--r-- | nephilim/mpclient.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/nephilim/mpclient.py b/nephilim/mpclient.py index 4d59185..66d1aa1 100644 --- a/nephilim/mpclient.py +++ b/nephilim/mpclient.py @@ -280,14 +280,14 @@ class MPClient(QtCore.QObject): return ret = None self._client.command_list_ok_begin() + for path in paths: + self.logger.info('Adding %s to playlist'%path) + if pos < 0: + self._client.addid(path.encode('utf-8')) + else: + self._client.addid(path.encode('utf-8'), pos) + pos += 1 try: - for path in paths: - self.logger.info('Adding %s to playlist'%path) - if pos < 0: - self._client.addid(path.encode('utf-8')) - else: - self._client.addid(path.encode('utf-8'), pos) - pos += 1 ret = list(self._client.command_list_end()) except mpd.CommandError, e: self.logger.error('Error adding files: %s.'%e) |