OSDN Git Service

fix b25 deleting function.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Wed, 14 Apr 2010 06:05:44 +0000 (06:05 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Wed, 14 Apr 2010 06:05:44 +0000 (06:05 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@558 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/checker.py
rec10/trunk/src/timerec.py
rec10/trunk/src/tv2ts.py

index 458a815..cfb6131 100644 (file)
@@ -6,21 +6,30 @@ import os
 import os.path
 import time
 import recdblist
-def checkB25Decode(b25filepath, decodedfilepath):
+
+def checkB25Decode(b25filepath, decodedfilepath , csch):
     ret = 0
     if os.path.isfile(decodedfilepath):##tsファイルが存在している
         dtime = time.time()-os.path.getmtime(decodedfilepath)
         dtime = int(dtime)
         if dtime > 20:
-            if (compareFilesize(b25filepath, decodedfilepath, 10) and minimizeCheck(decodedfilepath, 800)):
-                ret = 1
+            if csch>0:
+                if (compareFilesize(b25filepath, decodedfilepath, 10) and minimizeCheck(decodedfilepath, 800)):
+                    ret = 1
+            else:
+                if (compareFilesize(b25filepath, decodedfilepath, 90) and minimizeCheck(decodedfilepath, 800)):
+                    ret = 1
         else:
             time.sleep(30)
             dtime = time.time()-os.path.getmtime(decodedfilepath)
             dtime = int(dtime)
             if dtime > 20:
-                if (compareFilesize(b25filepath, decodedfilepath, 10) and minimizeCheck(decodedfilepath, 800)):
-                    ret = 1
+                if csch>0:
+                    if (compareFilesize(b25filepath, decodedfilepath, 10) and minimizeCheck(decodedfilepath, 800)):
+                        ret = 1
+                else:
+                    if (compareFilesize(b25filepath, decodedfilepath, 90) and minimizeCheck(decodedfilepath, 800)):
+                        ret = 1
     #recdblist.printutf8("deleting b25 is " + str(ret))
     return ret
 def compareFilesize(pathbase, path, percentage):
index 5b16e54..ab8da85 100644 (file)
@@ -520,7 +520,13 @@ def type_decode_que(typetxt,chtxt,title,bt,et,opt):
                 recdb.del_reckey(typetxting, title, chtxt, btime)
                 recdb.rec_reckey(typetxtmiss, title, chtxt, btime, etime, opt)
             else:
-                ch=checker.checkB25Decode(recpath + "/" + title + ".ts.b25", recpath + "/" + title + ".ts")
+                cstch=-1
+                try:
+                    cstch=int(chdb.chtxtsearch(chtxt)['csch'])
+                except:
+                    cstch=-1
+                if cstch>-1:
+                    ch=checker.checkB25Decode(recpath + "/" + title + ".ts.b25", recpath + "/" + title + ".ts",cstch)
                 #print ch
                 if ch == 1:
                     os.remove(recpath + "/" + title + ".ts.b25")
index 7eca6f4..3015ca4 100644 (file)
@@ -110,9 +110,6 @@ def b252tsmix(pin, pout):
         txt = unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8')
         recdblist.addlog(pin, txt, u"b25-log")
 def tsmix2ts(pin, pout, csch):#csch=0ならcsの処理をしない
-    """if csch==0:
-        shutil.move(pin,pout)
-    else:"""
     doexe = configreader.getpath("tssplitter") + " \""+ pin + "\" \""+ pout + "\" " + str(csch)
     doexe = "nice -n 18 " + doexe
     os.environ['LANG']="ja_JP.UTF-8"