send path info inline with new api

This commit is contained in:
j 2013-02-08 23:23:23 +05:30
parent ca299e5022
commit 4d5fe9e6f5

View file

@ -155,9 +155,19 @@ class Client(object):
def info(self, oshash): def info(self, oshash):
conn, c = self._conn() conn, c = self._conn()
c.execute('SELECT info FROM file WHERE oshash = ?', (oshash, )) c.execute('SELECT info FROM file WHERE oshash = ?', (oshash, ))
info = None
for row in c: for row in c:
return json.loads(row[0]) info = json.loads(row[0])
return None break
path = self.path(oshash)
if info and path:
path = '/'.join(path[0].split('/')[-self.folderdepth:])
info.update(ox.movie.parse_path(path))
if self.folderdepth == 3:
info['director'] = []
info['directorSort'] = []
print info
return info
def path(self, oshash): def path(self, oshash):
conn, c = self._conn() conn, c = self._conn()