load path info in right place
This commit is contained in:
parent
7684470842
commit
bf55bc1fba
1 changed files with 8 additions and 6 deletions
|
@ -217,10 +217,6 @@ class Client(object):
|
||||||
for row in c:
|
for row in c:
|
||||||
info = json.loads(row[0])
|
info = json.loads(row[0])
|
||||||
break
|
break
|
||||||
path = self.path(oshash)
|
|
||||||
if info and path:
|
|
||||||
path = '/'.join(path[0].split('/')[-self.folderdepth:])
|
|
||||||
info.update(parse_path(self, path) or {})
|
|
||||||
return info
|
return info
|
||||||
|
|
||||||
def path(self, oshash):
|
def path(self, oshash):
|
||||||
|
@ -373,6 +369,8 @@ class Client(object):
|
||||||
for name in sorted(self._config['volumes']):
|
for name in sorted(self._config['volumes']):
|
||||||
path = self._config['volumes'][name]
|
path = self._config['volumes'][name]
|
||||||
path = os.path.normpath(path)
|
path = os.path.normpath(path)
|
||||||
|
if not path.endswith('/'):
|
||||||
|
path += '/'
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
volumes[name] = path
|
volumes[name] = path
|
||||||
return volumes
|
return volumes
|
||||||
|
@ -382,8 +380,6 @@ class Client(object):
|
||||||
volumes = self.active_volumes()
|
volumes = self.active_volumes()
|
||||||
for name in sorted(volumes):
|
for name in sorted(volumes):
|
||||||
path = volumes[name]
|
path = volumes[name]
|
||||||
if not path.endswith('/'):
|
|
||||||
path += '/'
|
|
||||||
conn, c = self._conn()
|
conn, c = self._conn()
|
||||||
c.execute('SELECT path FROM file WHERE path LIKE ? AND deleted < 0', ["%s%%"%path])
|
c.execute('SELECT path FROM file WHERE path LIKE ? AND deleted < 0', ["%s%%"%path])
|
||||||
known_files = [r[0] for r in c.fetchall()]
|
known_files = [r[0] for r in c.fetchall()]
|
||||||
|
@ -501,6 +497,12 @@ class Client(object):
|
||||||
post = {'info': {}, 'upload': True}
|
post = {'info': {}, 'upload': True}
|
||||||
for oshash in info[offset:offset+max_info]:
|
for oshash in info[offset:offset+max_info]:
|
||||||
_info = self.info(oshash)
|
_info = self.info(oshash)
|
||||||
|
for path in self.path(oshash):
|
||||||
|
path = path[len(prefix):]
|
||||||
|
i = parse_path(self, path)
|
||||||
|
if i:
|
||||||
|
_info.update(i)
|
||||||
|
break
|
||||||
if _info:
|
if _info:
|
||||||
post['info'][oshash] = _info
|
post['info'][oshash] = _info
|
||||||
if len(post['info']):
|
if len(post['info']):
|
||||||
|
|
Loading…
Reference in a new issue