OSDN Git Service

ffmpeg fixaspect scaling added.
[rec10/rec10-git.git] / rec10 / trunk / src / auto_process.py
index e7ea3c9..65d0cf7 100644 (file)
@@ -66,30 +66,31 @@ def auto_check(path):
     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: