From 4d5fe9e6f539b9a90c0ec3b9119f54d29f4f9541 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 8 Feb 2013 23:23:23 +0530 Subject: [PATCH] send path info inline with new api --- pandora_client/__init__.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index 542cea7..cc12a2b 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -155,9 +155,19 @@ class Client(object): def info(self, oshash): conn, c = self._conn() c.execute('SELECT info FROM file WHERE oshash = ?', (oshash, )) + info = None for row in c: - return json.loads(row[0]) - return None + info = json.loads(row[0]) + 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): conn, c = self._conn()