diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index c93833d..1e46fce 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -223,6 +223,10 @@ class Client(object): for name in self._config['volumes']: path = self._config['volumes'][name] path = os.path.normpath(path) + conn, c = self._conn() + c.execute('SELECT path FROM file WHERE path LIKE ? AND deleted < 0', ["%s%%"%path]) + known_files = [r[0] for r in c.fetchall()] + files = [] for dirpath, dirnames, filenames in os.walk(path, followlinks=True): if isinstance(dirpath, str): @@ -237,11 +241,8 @@ class Client(object): files.append(file_path) self.scan_file(file_path) - conn, c = self._conn() - c.execute('SELECT path FROM file WHERE path LIKE ? AND deleted < 0', ["%s%%"%path]) - known_files = [r[0] for r in c.fetchall()] deleted_files = filter(lambda f: f not in files, known_files) - + conn, c = self._conn() if deleted_files: deleted = time.mktime(time.localtime()) for f in deleted_files: diff --git a/pandora_client/extract.py b/pandora_client/extract.py index 8c35fa5..c273b8d 100644 --- a/pandora_client/extract.py +++ b/pandora_client/extract.py @@ -130,8 +130,9 @@ def video_cmd(video, target, profile, info): if abs(width/height - dar) < 0.02: aspect = '%s:%s' % (width, height) + # '-g', '%d' % int(fps*2), video_settings = [ - '-vb', '%dk'%bitrate, '-g', '%d' % int(fps*2), + '-vb', '%dk'%bitrate, '-s', '%dx%d'%(width, height), '-aspect', aspect, '-vf', 'yadif',