ret=[]
BSCSUpdate=0
for datum in rec10d.rec10db.select_get_updatelogo_epg_ch("720"):
- bctype=datus[0]
+ bctype=datum[0]
if bctype == "cs1" or bctype == u"cs1":
- ret.append(u"bs")
- BSCSUpdate=1
+ if BSCSUpdate==0:
+ ret.append(u"bs")
+ BSCSUpdate=1
+ elif bctype == "cs2" or bctype == u"cs2":
+ if BSCSUpdate==0:
+ ret.append(u"bs")
+ BSCSUpdate=1
+ elif bctype == "bs" or bctype == u"bs":
+ if BSCSUpdate==0:
+ ret.append(u"bs")
+ BSCSUpdate=1
else:
ret.append(bctype)
return ret
status = 1\
WHERE bctype = %s AND chtxt = %s", (bctype, chtxt))
self.close_db(db)
+ def update_chname_by_chtxt_epg_ch(self,chtxt,chname):
+ db = self.connect_db()
+ db[1].execute("\
+ UPDATE epg_ch \
+ SET \
+ chname = %s \
+ WHERE chtxt = %s", (chname,chtxt))
+ self.close_db(db)
def update_status_by_bctype_epg_ch(self, bctype, status):
db = self.connect_db()
db[1].execute("\
r = list(dl)
ret=r[4]
return ret
- def change_installed_in_status(self):
+ def change_chscaned_in_status(self):
"""
installedを設定する
"""
db = self.connect_db()
db[1].execute("\
- UPDATE in_status SET installed=1")
+ UPDATE in_status SET installed=2")
self.close_db(db)
- def change_chscaned_in_status(self):
+ def change_installed_in_status(self,num=1):
"""
installedを設定する
"""
db = self.connect_db()
db[1].execute("\
- UPDATE in_status SET installed=2")
+ UPDATE in_status SET installed=%s",(num,))
self.close_db(db)
def new_epg_timeline(self, bctype):
db = self.connect_db()
self.change_version_in_status("98")
def update_db_98to100(self):
###ここで前のepg_chをバックアップしてchtxtの変換をする必要がある。
- db = self.connect_db()
self.drop_in_settings()
self.new_in_settings()
+ db = self.connect_db()
db[1].execute("\
UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT(CONCAT(epg_ch.ch,'_'),epg_ch.csch) WHERE NOT (substring(epg_ch.bctype,1,2) = 'bs' OR substring(epg_ch.bctype,1,2) = 'cs')")
db[1].execute("\
db[1].execute("\
ALTER TABLE in_auto_jbk_key ADD opt VARCHAR(20) DEFAULT \"\"")
self.close_db(db)
- self.change_installed_in_status()#チャンネルスキャンをさせる
+ self.change_installed_in_status(1)#チャンネルスキャンをさせる
self.change_version_in_status("100")
def update_db_100to101(self):
- db = self.connect_db()
self.drop_in_settings()
self.new_in_settings()
self.new_epg_ch()
+ db = self.connect_db()
try:
db[1].execute("\
ALTER TABLE timeline ADD epgcategory VARCHAR(100)\
except:
""
self.close_db(db)
+ self.change_installed_in_status(1)
+ self.change_version_in_status("101")
#self.change_installed_in_status()#チャンネルスキャンをさせる
- self.change_version_in_status("101")
\ No newline at end of file
+
\ No newline at end of file
rec10d.rec10db.new_epg_ch()\r
recdblist.printutf8(u"チャンネルスキャンの開始",verbose_level=100)\r
scan_ch.searchCh()\r
- rec10d.rec10db.change_chscaned_in_status()\r
+ rec10d.rec10db.change_installed_in_status(100)\r
#if os.path.exists(os.path.join(path,"chlist.xml")):\r
# recdblist.printutf8(u"チャンネルリストが見つかりました。||chlist.xml",verbose_level=100)\r
#else:\r
tmppath = configreader.getConfPath("tmp")+"/"
tssplitterp = configreader.getConfPath("tssplitter")
def searchCh():
+ rec10d.rec10db.change_installed_in_status(2)
#地上デジタル
for i in xrange(13,62):#62
recdblist.printuft8ex(u"チャンネルスキャン:地上デジタル CH "+str(i), 200, 200)
if checkTs("CS24")>0:
recdblist.printuft8ex(u"チャンネルスキャン:CSSデジタル CH:CS24", 200, 200)
addCh("CS24","cs2","CS")
+ rec10d.rec10db.change_installed_in_status(100)
def checkTs(ch):
tv2ts.tv2b25ts(os.path.join(tmppath,"ch_"+str(ch)+".ts"), ch, "1")
if os.path.exists(os.path.join(tmppath,"ch_"+str(ch)+".ts")):
#import guess
#import zenhan
#import auto_process
+import chdb
+import epgdb
import datetime
import tv2mp4
import ts2x264
ftpusr = "/home/ftpusr/ftp-tmp"
recordedpath = u"/home/ftpusr/ftp-video"
if __name__ == "__main__":
- rec10d.rec10db.update_db_100to101()
- #recque.searchRecQue(recpath)
\ No newline at end of file
+ #rec10d.rec10db.update_db_100to101()
+ #recque.searchRecQue(recpath)
+ #print chdb.updateLogo()
+ epgdb.updateLogo_bc("te23")
\ No newline at end of file
import scan_ch
rec10d.rec10db.new_epg_ch()
scan_ch.searchCh()
- rec10d.rec10db.change_chscaned_in_status()
+ rec10d.rec10db.change_installed_in_status(100)
+ elif rec10d.rec10db.select_installed_in_status()==2:
+ recdblist.printuft8ex("Exit because CH scanning.", 200, 200)
+ sys.exit(0)
except Exception, inst:
recdblist.addCommonlogEX("Error", "install_check(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
install.install()
sys.exit()
update = chdb.update()
updatelogo = chdb.updateLogo()
+ updatelogo=[]
if len(update) > 0:
pid = os.fork()
if pid != 0:
if os.access(pout + ".ts", os.F_OK):\r
os.remove(pout + ".ts")\r
time.sleep(10)\r
- tv2ts.tv2b25ts(pout+ ".ts", ch, time)\r
+ tv2ts.tv2b25ts(pout+ ".ts", ch, times)\r
logoopt=""\r
if islogo==1:\r
logoopt="/LOGO "\r