From 90e463f61bb2aeed5160cd66cc1a84c665bd7d2f Mon Sep 17 00:00:00 2001 From: gn64_jp Date: Tue, 10 Apr 2012 10:46:04 +0000 Subject: [PATCH] fix error. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@930 4e526526-5e11-4fc0-8910-f8fd03428081 --- rec10/trunk/src/timerec.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/rec10/trunk/src/timerec.py b/rec10/trunk/src/timerec.py index 93105ea..4937208 100644 --- a/rec10/trunk/src/timerec.py +++ b/rec10/trunk/src/timerec.py @@ -302,22 +302,23 @@ def search_keyword(key): #if status.getSettings_auto_jbk()==1: if auto==1 or status.getSettings_auto_jbk()==1: topt=opt - if len(topt)==0: - topt=status.getSettings_auto_opt() - try: - maxnum=0 - ch=chdb.searchCHFromChtxt(chtxtt) - if len(ch['ch'])>2: - maxnum=epgdb.countSchedule(btimet, etimet)[1] - maxnum=int(configreader.getConfEnv("bscs_max"))-maxnum - else: - maxnum=epgdb.countSchedule(btimet, etimet)[0] - maxnum=int(configreader.getConfEnv("te_max"))-maxnum - if maxnum>0: - if recdb.checkDuplicated(titlet, chtxtt, btimet, etimet)==0: - recdb.reserveReckey(recdblist.REC_RESERVE,titlet,chtxtt, btimet, etimet,topt) - except Exception, inst: - recdblist.addCommonlogEX("Error", "search_keyword_auto_jbk(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200) + if topt!=None: + if len(topt)==0: + topt=status.getSettings_auto_opt() + try: + maxnum=0 + ch=chdb.searchCHFromChtxt(chtxtt) + if len(ch['ch'])>2: + maxnum=epgdb.countSchedule(btimet, etimet)[1] + maxnum=int(configreader.getConfEnv("bscs_max"))-maxnum + else: + maxnum=epgdb.countSchedule(btimet, etimet)[0] + maxnum=int(configreader.getConfEnv("te_max"))-maxnum + if maxnum>0: + if recdb.checkDuplicated(titlet, chtxtt, btimet, etimet)==0: + recdb.reserveReckey(recdblist.REC_RESERVE,titlet,chtxtt, btimet, etimet,topt) + except Exception, inst: + recdblist.addCommonlogEX("Error", "search_keyword_auto_jbk(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200) try: recdb.reserveAutoKeyword(chtxtt, titlet, btimet, etimet) except Exception, inst: -- 2.11.0