+ bttt=datetime.datetime.strptime(start,"%Y%m%d%H%M%S")
+ bttt=bttt-datetime.timedelta(seconds=1200)
+ bttime=bttt.strftime("%Y-%m-%d %H:%M:%S")
+ ettt=datetime.datetime.strptime(stop,"%Y%m%d%H%M%S")
+ ettt=ettt+datetime.timedelta(seconds=1200)
+ ettime=ettt.strftime("%Y-%m-%d %H:%M:%S")
+ chs=rec10d.rec10db.select_bytime_bychtxt_all_timeline(bttime,ettime,tch['chtxt'])
+ p2=0
+ if len(chs)>0:
+ for ch in chs:
+ p2t=n_gram.trigram(ch['title'],title)
+ if p2t>p2:
+ p2=p2t
+ if p2<350:
+ if status.getSettings_auto_bayes()==1:
+ if p2<200:
+ maxnum=0
+ if len(ch['ch'])>2:
+ maxnum=epgdb.count_schedule_timeline(bttime, ettime)[1]
+ maxnum=int(configreader.getConfEnv("bscs_max"))-maxnum
+ else:
+ maxnum=epgdb.count_schedule_timeline(bttime, ettime)[0]
+ maxnum=int(configreader.getConfEnv("te_max"))-maxnum
+ if maxnum>0:
+ topt=status.getSettings_auto_opt()
+ recdb.reserveReckey(recdblist.REC_RESERVE,title,tch['chtxt'], bttime, ettime,topt)
+ else:
+ recdb.addAutoBayesKeyword(tch['chtxt'],title,start,stop,p)