remove debug, avoid returning same path twice
This commit is contained in:
parent
28abab29a7
commit
2809ebb07b
1 changed files with 3 additions and 4 deletions
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue