# Copyright (C) 2009-2010 Yukikaze
import datetime
import os
+import os.path
+import glob
+import time
+import traceback
import configreader
import recdblist
et=bt+datetime.timedelta(minutes=30)
btime=bt.strftime("%Y-%m-%d %H:%M:%S")
etime=et.strftime("%Y-%m-%d %H:%M:%S")
- recdb.rec_reckey(dbkey, title, chtxt, btime, etime, opts)
+ if len(dbkey)>2:
+ recdb.rec_reckey(dbkey, title, chtxt, btime, etime, opts)
+def searchRecQue(folderpath):
+ for file in glob.glob(os.path.join(folderpath,"*.recq")):
+ dtime = time.time()-os.path.getmtime(avipath)
+ dtime = int(dtime)
+ if dtime > 300:
+ try:
+ readRecQue(os.path.join(folderpath, file))
+ os.remove(os.path.join(folderpath, file))
+ except Exception, inst:
+ recdblist.Commonlogex("Error", "searchRecQue(recque.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)
+
\ No newline at end of file
+import recque
#!/usr/bin/python
# coding: UTF-8
# Rec10 TS Recording Tools
else:
for k in recdb.get_key():
search_keyword(k)
+ recque.searchRecQue(recpath)
sys.exit()
else:
pid = os.fork()
else:
try:
shutil.copy(os.path.join(recpath,title+".ts.b25"), os.path.join(movepath,title+".ts.b25"))
+ os.chmod(os.path.join(movepath,title+".ts.b25"),0777)
+ recque.writeRecQue(movepath, chtxt, title, opt)
+ os.chmod(os.path.join(movepath,title+".recq"),0777)
except:
""
recdb.rec_reckey(recdblist.REC_MOVE_END, newtitle, chtxt, btime, etime, opt)
else:
try:
shutil.copy(os.path.join(recpath,title+".ts"), os.path.join(movepath,title+".ts"))
+ os.chmod(os.path.join(movepath,title+".ts"),0777)
+ recque.writeRecQue(movepath, chtxt, title, opt)
+ os.chmod(os.path.join(movepath,title+".recq"),0777)
time.sleep(5)
if os.path.getsize(os.path.join(recpath,title+".ts"))==os.path.getsize(os.path.join(movepath,title+".ts")):
os.remove(os.path.join(recpath,title+".ts"))
try:
if os.path.exists(os.path.join(recpath,title+".mp4")):
shutil.copy(os.path.join(recpath,title+".mp4"), os.path.join(movepath,title+".mp4"))
+ os.chmod(os.path.join(movepath,title+".mp4"),0777)
+ recque.writeRecQue(movepath, chtxt, title, opt)
+ os.chmod(os.path.join(movepath,title+".recq"),0777)
elif os.path.exists(os.path.join(recpath,title+".mkv")):
shutil.copy(os.path.join(recpath,title+".mkv"), os.path.join(movepath,title+".mkv"))
+ os.chmod(os.path.join(movepath,title+".mkv"),0777)
+ recque.writeRecQue(movepath, chtxt, title, opt)
+ os.chmod(os.path.join(movepath,title+".recq"),0777)
except Exception, inst:
errtxt1="move mkv/mp4 error."
errtxt2=str(type(inst))+"\n"