tbtime=datetime.datetime.now()+datetime.timedelta(seconds=60)
tbtime2=datetime.datetime.now()+datetime.timedelta(seconds=1200)
for fn in filelist:
- if fn.rfind("sa.avi")==-1 and fn.rfind(".120.avi")==-1 and os.path.getsize(fn)>1*1000*1000:
- dir = os.path.split(fn)[0]
- file = os.path.split(fn)[1]
- title = os.path.splitext(file)[0]
- title = unicode(title,'utf-8')
- ext = os.path.splitext(file)[1]
- if ext == ".b25":
- title=title.replace(".ts","")
- dbs=rec10d.rec10db.select_by_name_time_timeline(title,tbtime,tbtime2)
- if len(dbs)==0:
- proc=check_process(dir, title)
- chtxtt=rec10d.rec10db.select_chtxt_by_title_timeline_log(title)
- nchtxt=""
- if chtxtt!=None:
- nchtxt=chtxtt
- if proc=="b25":
- add.append([recdblist.REC_AUTO_SUGGEST_DECODE,title,nchtxt])
- elif proc=="ts":
- add.append([recdblist.REC_AUTO_SUGGEST_ENCODE,title,nchtxt])
- elif proc =="264":
- add.append([recdblist.REC_AUTO_SUGGEST_AVI2FP,title,nchtxt])
- #elif proc =="mp4":
- # add.append([recdblist.REC_AUTO_SUGGEST_AP2FP,title,nchtxt])
- #print add
+ if os.path.exists(fn):
+ if fn.rfind("sa.avi")==-1 and fn.rfind(".120.avi")==-1 and os.path.getsize(fn)>1*1000*1000:
+ dir = os.path.split(fn)[0]
+ file = os.path.split(fn)[1]
+ title = os.path.splitext(file)[0]
+ title = unicode(title,'utf-8')
+ ext = os.path.splitext(file)[1]
+ if ext == ".b25":
+ title=title.replace(".ts","")
+ dbs=rec10d.rec10db.select_by_name_time_timeline(title,tbtime,tbtime2)
+ if len(dbs)==0:
+ proc=check_process(dir, title)
+ chtxtt=rec10d.rec10db.select_chtxt_by_title_timeline_log(title)
+ nchtxt=""
+ if chtxtt!=None:
+ nchtxt=chtxtt
+ if proc=="b25":
+ add.append([recdblist.REC_AUTO_SUGGEST_DECODE,title,nchtxt])
+ elif proc=="ts":
+ add.append([recdblist.REC_AUTO_SUGGEST_ENCODE,title,nchtxt])
+ elif proc =="264":
+ add.append([recdblist.REC_AUTO_SUGGEST_AVI2FP,title,nchtxt])
+ #elif proc =="mp4":
+ # add.append([recdblist.REC_AUTO_SUGGEST_AP2FP,title,nchtxt])
+ #print add
if len(add)>0:
rec10d.rec10db.new_auto_proc()
for a in add:
smsize = 10*1000*1000
dp=[]
if level > 0 :
- if os.path.exists(os.path.join(path,title+".ts"))and os.path.exists(os.path.join(path,title+".ts.b25")):
+ if os.path.exists(os.path.join(path,title+".ts")) and os.path.exists(os.path.join(path,title+".ts.b25")):
if os.path.getsize(os.path.join(path,title+".ts"))*10>os.path.getsize(os.path.join(path,title+".ts.b25")):
- if os.path.getsize(os.path.join(path,title+".ts"))>1000*1000*100:
- dp.append(os.path.join(path,title+".ts.b25"))
+ dp.append(os.path.join(path,title+".ts.b25"))
if level > 4 :
if configreader.getenv("remove_ts")=="1":
dp.append(os.path.join(path,title+".ts"))