From 2809ebb07bb491b367fa0afd4d7aa158f860fcac Mon Sep 17 00:00:00 2001 From: j Date: Fri, 23 Sep 2016 13:22:07 +0200 Subject: [PATCH] remove debug, avoid returning same path twice --- pandora_client/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index 2a362df..e021b4e 100755 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -304,12 +304,12 @@ class Client(object): def path(self, oshash): conn, c = self._conn() c.execute(u'SELECT path FROM file WHERE oshash = ?', (oshash, )) - paths = [] + paths = set() for row in c: path = row[0] - paths.append(path) + paths.add(path) conn.close() - return paths + return list(paths) def online(self): self.api = API(self._config['url'], media_cache=self.media_cache()) @@ -717,7 +717,6 @@ class Client(object): if documents: _documents = [] for oshash, item in documents: - print(oshash, self.path(oshash)) for path in self.path(oshash): if os.path.exists(path): _documents.append([path, item])