OSDN Git Service

implement auto prcess suggestion system.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Tue, 24 Nov 2009 02:40:05 +0000 (02:40 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Tue, 24 Nov 2009 02:40:05 +0000 (02:40 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@239 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/epgdb.py
rec10/trunk/src/timerec.py
rec10/trunk/src/tv2mp4.py

index e095542..07caf03 100644 (file)
@@ -14,6 +14,8 @@ import xml2db
 import configreader
 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
 tmppath = configreader.getpath("tmp")+"/"
+if tmppath=="":
+    tmppath=path
 def update(chtxt):
     print chtxt
     tnow = datetime.datetime.now()
index cc908a3..1e66ed8 100644 (file)
@@ -11,6 +11,7 @@ import time
 import shutil
 
 import auto_rec
+import auto_process
 import chdb
 import checker
 import configreader
@@ -44,6 +45,14 @@ def task():
         else:
             for k in recdb.get_key():
                 search_keyword(k)
+            sys.exit()
+    else:
+        pid = os.fork()
+        if pid!=0:
+            time.sleep(1)
+        else:
+            auto_process.auto_check(recpath)
+            sys.exit()
     update = chdb.update()
     print update
     if len(update) > 0:
index ef8edff..9ebebbc 100644 (file)
@@ -57,6 +57,11 @@ def mkv2mp4(pin,pout):
     title=os.path.split(pin)[1]
     title=os.path.splitext(title)[0]
     audiopath=os.path.join(dir,title+"_audio.mp3")
+    if not os.path.exists(audiopath):
+        if os.path.exists(os.path.join(dir,title+"_audio.raw")):
+            audiopath=os.path.join(dir,title+"_audio.raw")
+        if os.path.exists(os.path.join(dir,title+"_audio.aac")):
+            audiopath=os.path.join(dir,title+"_audio.aac")
     videopath=os.path.join(dir,title+"_video.h264")
     #doexe = exe.encode('utf-8') + u' \"' + pin.encode('utf-8') + u'\" \"' + pout.encode('utf-8') + u'\"'
     exe0=exeb+" tracks \'"+pin+"\' 1:\'"+videopath+"\' 2:\'"+audiopath+"\'"