OSDN Git Service

implement personal epg updating(beta).
[rec10/rec10-git.git] / rec10 / trunk / src / timerec.py
index ccfc705..b7a5279 100644 (file)
@@ -32,6 +32,7 @@ def task():
 
     #if inum+status.getBSCSRecording()+status.getTERecording() < 2:
     update=chdb.update()
+    print update
     print "番組表更新処理"
     if len(update)>0:
         pid=os.fork()
@@ -117,7 +118,7 @@ def task():
                 else:#子プロセスの場合 アップデートを行って終了
                     bctypet=chdb.chtxtsearch(chtxt)['bctype']
                     chdatat=rec10d.rec10db.select_by_bctype_chdata(bctypet)
-                    dt1=datetime.datetime.now()-datetime.datetime.strptime(chdatat[5],"%Y-%m-%d %H:%M:%S")
+                    dt1=datetime.datetime.now()-datetime.datetime.strptime(chdatat[0][5],"%Y-%m-%d %H:%M:%S")
                     dt1=dt1.days*24*60*60+dt1.seconds
                     if dt1<60*60:
                         recdata=epgdb.searchtime2(title.decode('utf-8'),btime,"5",chtxt)
@@ -140,6 +141,7 @@ def task():
                             print "nothing match"
                     else:
                         rec10d.rec10db.update_status_by_bctype_chdata(bctypet,"3")
+                    sys.exit()
                     """cht=chdb.chtxtsearch(chtxt)['bctype']
                     if cht.find('te')!=-1:
                         cht='te'
@@ -330,4 +332,4 @@ def task():
                     et=et+datetime.timedelta(seconds=600)
                     btime=bt.strftime("%Y-%m-%d %H:%M:%S")
                     etime=et.strftime("%Y-%m-%d %H:%M:%S")
-                    recdb.rec_reckey(recdb.REC_ENCODE_QUE,title,chtxt,btime,etime,opt)
\ No newline at end of file
+                    recdb.rec_reckey(recdb.REC_ENCODE_QUE,title,chtxt,btime,etime,opt)