OSDN Git Service

implement auto-rename when same title there already.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 8 Oct 2009 11:56:07 +0000 (11:56 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 8 Oct 2009 11:56:07 +0000 (11:56 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@176 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/classify.py
rec10/trunk/src/timerec.py

index 2708ee6..55774af 100644 (file)
@@ -93,7 +93,8 @@ def search_mkv(temppath,recpath):
 
 def veryfySize(path):
     #vsize=[297,497,596,1196]#SD 30m 1h 1.5h 2h
-    vsize=[295,591]
+    vsize=[295,591,830]
+    vsize=vsize+[325,560,590,860]
     #vsize=vsize+[458,916]#HD 30m 1h
     #vsize=vsize+[381,895,447]
     ret = 0
index 5c0d28c..5f926c5 100644 (file)
@@ -186,8 +186,20 @@ def task():
                 if pid != 0:#親プロセスの場合
                     ""
                 else:
+                    ttitle=title
                     #print title
-                    tv2avi.timetv2b25(recpath + "/" + title + ".avi", chtxt, btime, etime, opt)
+                    testpath=[os.path.join(recpath,title+".ts.b25")]
+                    testpath.append(os.path.join(recpath,title+".ts"))
+                    testpath.append(os.path.join(recpath,title+".avi"))
+                    testpath.append(os.path.join(recpath,title+".mkv"))
+                    testpath.append(os.path.join(recpath,title+".log"))
+                    tcheck=0
+                    for ti in testpath:
+                        if os.path.exists(ti):
+                            tcheck=tcheck+1
+                    if tcheck>0:
+                        ttitle=title+"_"+datetime.datetime.now().strftime("%Y%m%d%H%M")
+                    tv2avi.timetv2b25(recpath + "/" + ttitle + ".avi", chtxt, btime, etime, opt)
                     recdb.del_reckey(recdb.REC_TS_RECORDING, title, chtxt, btime)
                     tnow = datetime.datetime.now()
                     bt = datetime.datetime.strptime(btime, "%Y-%m-%d %H:%M:%S")
@@ -197,7 +209,7 @@ def task():
                     et = et + dt + datetime.timedelta(seconds=600)
                     btime = bt.strftime("%Y-%m-%d %H:%M:%S")
                     etime = et.strftime("%Y-%m-%d %H:%M:%S")
-                    recdb.rec_reckey(recdb.REC_TS_DECODE_QUE, title, chtxt, btime, etime, opt)
+                    recdb.rec_reckey(recdb.REC_TS_DECODE_QUE, ttitle, chtxt, btime, etime, opt)
                     sys.exit()
         elif task["type"] == recdb.REC_TS_DECODE_QUE:
             if dt < 10 * 60: