From f58ed28f0139479ee35b36e6bb789f34a4c3d224 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 21 Jul 2007 19:23:07 +0000 Subject: [PATCH] new cron functions --- oxdbarchive/cron.py | 12 ++++++++++-- oxdbarchive/model.py | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/oxdbarchive/cron.py b/oxdbarchive/cron.py index 33747e4..27e0fc0 100644 --- a/oxdbarchive/cron.py +++ b/oxdbarchive/cron.py @@ -4,10 +4,19 @@ from model import * -def findeNew(): + +def findNew(): archive = Archive.get(1) archive.importFiles() +def extractFrames(): + for f in ArchiveFile.select(ArchiveFile.q.extracted == False): + f.extractFrames() + +def extractTimelines(): + for f in ArchiveFile.select(ArchiveFile.q.extracted == False): + f.extractTimeline() + def extractNew(): for f in ArchiveFile.select(ArchiveFile.q.extracted == False): f.extractAll() @@ -16,7 +25,6 @@ def cleanScrapeitCache(): #remove files older than 30 days from scrapeit cache os.system("""find /var/cache/scrapeit/ -type f -ctime +30 -exec rm '{}' \;""") - def cleanClipMovieCache(): cache = os.path.abspath('oxdb/cache/mini/') for d, p, files in os.walk(cache): diff --git a/oxdbarchive/model.py b/oxdbarchive/model.py index 6146b9a..60104f6 100644 --- a/oxdbarchive/model.py +++ b/oxdbarchive/model.py @@ -488,7 +488,7 @@ class ArchiveFile(SQLObject): options += " -ovc lavc -lavcopts vcodec=mjpeg" options += " -af volnorm=1 -oac mp3lame -lameopts br=64:mode=3 -af resample=44100" options += " -vf scale -zoom -xy 128" - options += ' "%s"' % movie_file + options += ' "%s"' % movie_file.replace('"', '\\"') options += ' -o "%s"' % mini_movie_file cmd = "mencoder %s >/dev/null 2>&1" % options print cmd.encode('utf-8')