OSDN Git Service

fix ch,csch not number problem.
[rec10/rec10-git.git] / rec10 / trunk / src / tv2ts.py
index 1c02c55..8e2c7e7 100644 (file)
@@ -21,18 +21,22 @@ def tv2tsmix(pout, ch, time,getlog=0):
     #    except:
     #        ""
 def tv2ts(pout, ch, csch, time):
-    if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
-        status.changeBSCSRecording(1)
-    else:
-        status.changeTERecording(1)
-    try:
-        tv2b25ts(pout + ".b25", ch, time)
-    except Exception, inst:
-        recdblist.addCommonlogEX(u"Error",u"tv2ts(tv2ts.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-    if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
-        status.changeBSCSRecording(-1)
+    if ch.replace(" ","").isdigit():
+        if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
+            status.changeBSCSRecording(1)
+        else:
+            status.changeTERecording(1)
+        try:
+            tv2b25ts(pout + ".b25", ch, time)
+        except Exception, inst:
+            recdblist.addCommonlogEX(u"Error",u"tv2ts(tv2ts.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+        if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
+            status.changeBSCSRecording(-1)
+        else:
+            status.changeTERecording(-1)
     else:
-        status.changeTERecording(-1)
+         ch="0"
+         csch="0"
     b252tsmix(pout + ".b25", pout + ".tsmix")
     tch="0"
     if csch!=u"0":
@@ -53,12 +57,15 @@ def tv2ts(pout, ch, csch, time):
 def b252ts(pout, ch, csch):
     b252tsmix(pout + ".b25", pout + ".tsmix")
     tch=u"0"
-    if csch!=u"0":
-        tch=csch
-    elif ch==u"101":
-        tch=u"101"
-    elif ch==u"102":
-        tch=u"102"
+    if ch.replace(" ","").isdigit():
+        if csch!=u"0":
+            tch=csch
+        elif ch==u"101":
+            tch=u"101"
+        elif ch==u"102":
+            tch=u"102"
+    else:
+        tch="0"
     tsmix2ts(pout + ".tsmix", pout, tch)
 def tv2b25ts(pout, ch, time):
     exe = configreader.getConfPath('recpt1')