OSDN Git Service

make DVB driver usable.
[rec10/rec10-git.git] / rec10 / trunk / src / timerec.py
index a821e60..18c403a 100644 (file)
@@ -41,7 +41,10 @@ def task():
             import scan_ch
             rec10d.rec10db.new_epg_ch()
             scan_ch.searchCh()
-            rec10d.rec10db.change_chscaned_in_status()
+            rec10d.rec10db.change_installed_in_status(100)
+        elif rec10d.rec10db.select_installed_in_status()==2:
+            recdblist.printutf8ex("Exit because CH scanning.", 200, 200)
+            sys.exit(0)
     except Exception, inst:
         recdblist.addCommonlogEX("Error", "install_check(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         install.install()
@@ -75,6 +78,7 @@ def task():
             sys.exit()
     update = chdb.update()
     updatelogo = chdb.updateLogo()
+    updatelogo=[]
     if len(update) > 0:
         pid = os.fork()
         if pid != 0:
@@ -112,14 +116,14 @@ def task():
                 recnum = 0
                 if bctype.find('te') > -1:
                     recnum = status.getTERecording() + recdb.countRecNow_minutes_TE("1200")
-                    recdblist.printutf8(u"ロゴ取得 : 放送種別-"+bctype + u"||該当チューナー実行中件数:" + str(status.getTERecording()) + u":直近予約件数:" + str(recdb.countRecNow_minutes_TE("10")),verbose_level=800)
+                    recdblist.printutf8(u"ロゴ取得 : 放送種別-"+bctype + u"||該当チューナー実行中件数:" + str(status.getTERecording()) + u":直近予約件数:" + str(recdb.countRecNow_minutes_TE("10")),verbose_level=800)
                     recnum = int(configreader.getConfEnv("te_max")) -recnum
                 else:
                     recnum = status.getBSCSRecording() + recdb.countRecNow_minutes_BSCS("1200")
-                    recdblist.printutf8(u"ロゴ取得 : 放送種別-"+bctype + u"||該当チューナー実行中件数:" + str(status.getBSCSRecording()) + u":直近予約件数:" + str(recdb.countRecNow_minutes_BSCS("10")),verbose_level=800)
+                    recdblist.printutf8(u"ロゴ取得 : 放送種別-"+bctype + u"||該当チューナー実行中件数:" + str(status.getBSCSRecording()) + u":直近予約件数:" + str(recdb.countRecNow_minutes_BSCS("10")),verbose_level=800)
                     recnum = int(configreader.getConfEnv("bscs_max")) -recnum
                 if recnum >0 :
-                    recdblist.printutf8(str(updatelogo),verbose_level=750)
+                    recdblist.printutf8(u"ロゴ取得"+str(updatelogo),verbose_level=750)
                     rec10d.rec10db.update_logostatus_by_bctype_epg_ch(bctype,"0")
                     epgdb.updateLogo_bc(bctype)
                     updatelogo = chdb.updateLogo()
@@ -223,10 +227,10 @@ def task():
                 if pid > 0:#親プロセスの場合
                     ""
                 else:
-                    makeMP4=0
+                    makeMP4=1
                     try:
-                        if configreader.getConfEnv("make_mp4")==1:
-                            makeMP4=1
+                        if configreader.getConfEnv("make_mp4")==0:
+                            makeMP4=0
                     except:
                         ""
                     if re.search("m", opt):
@@ -238,7 +242,9 @@ def task():
                     if makeMP4==1:
                         tv2mp4.raw2mp4(os.path.join(recpath,title+".264"),os.path.join(recpath,title+".mp4"),opt)
                     else:
-                        tv2mkv.raw2mkv(os.path.join(recpath,title+".264"),os.path.join(recpath,title+".mkv"),opt)
+                        tv2mp4.raw2mp4(os.path.join(recpath,title+".264"),os.path.join(recpath,title+".mp4"),opt)
+                        tv2mkv.mp42mkv(os.path.join(recpath,title+".mp4"), os.path.join(recpath,title+".mkv"))
+                        os.remove(os.path.join(recpath,title+".mp4"))
                     recdb.deleteReckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime)
                     sys.exit()
         elif task["type"] == recdblist.REC_AVI_TO_MP4:
@@ -497,7 +503,7 @@ def type_keyword(typetxt,chtxt,title,bt,et,opt,deltatime):
         recdb.deleteReckey(typetxtnow, title, chtxt, btime)
         recdb.reserveReckey(typetxtres, title, chtxt, btime, etime, opt)
         recdblist.addCommonlogEX(u"エラー","timerec.py",u"nothing match","",log_level=200)
-        recdblist.addCommonlogEX(u"エラー","timerec.py",u"key "+title+u" : "+titlet+u" "+btimet+u" "+etimet,"",log_level=200)
+        recdblist.addCommonlogEX(u"エラー","timerec.py",u"key "+title+u" "+btime+u" "+etime,"",log_level=200)
 def type_keyword_every_day(type,chtxt,title,bt,et,opt,deltatime,deltaday,counter):
     btime = bt.strftime("%Y-%m-%d %H:%M:%S")
     etime = et.strftime("%Y-%m-%d %H:%M:%S")
@@ -648,6 +654,14 @@ def type_encode_que(typetxt,chtxt,title,bt,et,opt):
                     if not os.path.exists(paac2) and not os.path.exists(pmp32):
                         tv2audio.ts2pentaaudio_BonTsDemux(os.path.join(recpath, title+".ts"), recdblist.BONTSDEMUX_DELAY, opt)
                 time.sleep(3)
+            elif re.search("b", opt):
+                pin = recpath + "/" + title + ".m2v"
+                if not os.path.exists(pin) or os.path.getsize(pin)<100*1000:
+                    paac2 = recpath + "/" + title + ".aac"
+                    pmp32 = recpath + "/" + title + ".mp3"
+                    if not os.path.exists(paac2) and not os.path.exists(pmp32):
+                        tv2audio.ts2single_fp_BonTsDemux(os.path.join(recpath, title+".ts"),opt)
+                time.sleep(3)
             makeMP4=0
             try:
                 if configreader.getConfEnv("make_mp4")=="1":