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):
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")
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"