logo2 BLOB,\
logo3 BLOB,\
logo4 BLOB,\
- logo5 BLOB\
+ logo5 BLOB,\
+ logoupdate DATETIME,\
+ logostatus TINYINT DEFAULT 2,\
+ scanupdate DATETIME\
)')
except Exception, inst:
if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
recdblist.addCommonlogEX("Error", "new_epg_ch (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
self.close_db(db)
- def add_epg_ch(self, bctype, chtxt, ch, csch, updatetime):
+ def add_epg_ch(self, bctype, chtxt, ch, csch, updatetime,logoupdate,scanupdate):
db = self.connect_db()
db[1].execute('\
- INSERT INTO epg_ch (bctype,chtxt,ch,csch,chname,updatetime,status,visible)\
- VALUES (%s,%s,%s,%s,"",%s,%s,%s)', \
- (bctype, chtxt, ch, csch, updatetime, "1","1"))
+ INSERT INTO epg_ch (bctype,chtxt,ch,csch,chname,updatetime,status,visible,logoupdate,scanupdate)\
+ VALUES (%s,%s,%s,%s,"",%s,%s,%s,%s,%s)', \
+ (bctype, chtxt, ch, csch, updatetime, "1","1",logoupdate,scanupdate))
self.close_db(db)
def delete_all_epg_ch(self):
db = self.connect_db()
def select_by_chtxt_epg_ch(self, chtxt):
db = self.connect_db()
dbexe = db[1].execute("\
- SELECT bctype,chtxt,ch,csch,updatetime,chname,status,visible \
+ SELECT bctype,chtxt,ch,csch,updatetime,chname,status,visible,logoupdate,scanupdate \
FROM epg_ch \
WHERE chtxt LIKE %s", \
(chtxt,))
for dl in dls:
r = list(dl)
r[4] = r[4].strftime("%Y-%m-%d %H:%M:%S")
+ r[8] = r[8].strftime("%Y-%m-%d %H:%M:%S")
+ r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
ret.append(r)
return ret
def select_by_bctype_epg_ch(self, bctype):
db = self.connect_db()
dbexe = db[1].execute("\
- SELECT bctype,chtxt,ch,csch,updatetime,status,chname,status,visible \
+ SELECT bctype,chtxt,ch,csch,updatetime,status,chname,status,visible,logoupdate,scanupdate \
FROM epg_ch \
WHERE bctype = %s", \
(bctype,))
#recdblist.printutf8(dl)
r = list(dl)
r[4] = r[4].strftime("%Y-%m-%d %H:%M:%S")
+ r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
+ r[10] = r[10].strftime("%Y-%m-%d %H:%M:%S")
r[5] = str(r[5])
ret.append(r)
return ret
db = self.connect_db()
dbexe = db[1].execute("\
SELECT \
- bctype,chtxt,ch,csch,updatetime,chname,status,visible \
+ bctype,chtxt,ch,csch,updatetime,chname,status,visible,logoupdate,scanupdate \
FROM epg_ch \
WHERE ch = %s", \
(ch,))
for dl in dls:
r = list(dl)
r[4] = r[4].strftime("%Y-%m-%d %H:%M:%S")
+ r[8] = r[8].strftime("%Y-%m-%d %H:%M:%S")
+ r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
ret.append(r)
return ret
def select_by_csch_epg_ch(self, csch):
db = self.connect_db()
dbexe = db[1].execute("\
SELECT \
- bctype,chtxt,ch,csch,updatetime,chname,status,visible \
+ bctype,chtxt,ch,csch,updatetime,chname,status,visible,logoupdate,scanupdate \
FROM epg_ch \
WHERE csch = %s", \
(csch,))
for dl in dls:
r = list(dl)
r[4] = r[4].strftime("%Y-%m-%d %H:%M:%S")
+ r[8] = r[8].strftime("%Y-%m-%d %H:%M:%S")
+ r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
ret.append(r)
return ret
def select_all_epg_ch(self):
db = self.connect_db()
dbexe = db[1].execute("\
- SELECT bctype,chtxt,ch,csch,updatetime,chname,status,visible \
+ SELECT bctype,chtxt,ch,csch,updatetime,chname,status,visible,logoupdate,scanupdate \
FROM epg_ch \
")
ret = []
for dl in dls:
r = list(dl)
r[4] = r[4].strftime("%Y-%m-%d %H:%M:%S")
+ r[8] = r[8].strftime("%Y-%m-%d %H:%M:%S")
+ r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
ret.append(r)
return ret
def change_visible_epg_ch(self,chtxt,visible):
db[1].execute("\
UPDATE epg_ch SET visible=%s WHERE chtxt=%s",(visible,chtxt))
self.close_db(db)
- def change_visible_epg_ch(self,chtxt,logonum,logodata):
+ def change_logodata_epg_ch(self,chtxt,logonum,logodata):
db = self.connect_db()
db[1].execute("\
UPDATE epg_ch SET logo"+str(logonum)+"=%s WHERE chtxt=%s",(logodata,chtxt))
ret = db[1].fetchall()
self.close_db(db)
return ret
+ def select_get_updatelogo_epg_ch(self, dhour):
+ db = self.connect_db()
+ dbexe = db[1].execute("SELECT bctype,chtxt,logostatus FROM epg_ch \
+ WHERE (\
+ ( \
+ updatetime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR) \
+ AND \
+ logostatus = 1 \
+ ) \
+ OR \
+ logostatus > 1 )\
+ ORDER BY status DESC")
+ ret = []
+ #recdblist.printutf8(dbexe)
+ if dbexe > 0:
+ ret = db[1].fetchall()
+ self.close_db(db)
+ return ret
def update_by_bctype_epg_ch(self, bctype):
db = self.connect_db()
db[1].execute("\
status = 1 \
WHERE bctype = %s", (bctype,))
self.close_db(db)
+
def update_by_bctype_and_chtxt_epg_ch(self, bctype, chtxt):
db = self.connect_db()
db[1].execute("\
(status, bctype)\
)
self.close_db(db)
- def update_chname_by_chtxt_epg_ch(self,chtxt,chname):
+ def update_status_by_bctype_epg_ch(self, bctype, status):
+ db = self.connect_db()
+ db[1].execute("\
+ UPDATE epg_ch \
+ SET \
+ status=%s , \
+ updatetime=now() \
+ WHERE bctype = %s", \
+ (status, bctype)\
+ )
+ self.close_db(db)
+ def update_logostatus_by_bctype_epg_ch(self,bctype,logostatus):
db = self.connect_db()
db[1].execute("\
UPDATE epg_ch \
SET \
- chname=%s \
- WHERE chtxt = %s", \
- (chname, chtxt)\
+ logostatus=%s , \
+ logoupdate=now() \
+ WHERE bctype = %s", \
+ (logostatus, bctype)\
)
self.close_db(db)
def add_auto_proc_tmp(self,type,title,chtxt):
except:
""
self.close_db(db)
- self.change_installed_in_status()#チャンネルスキャンをさせる
+ #self.change_installed_in_status()#チャンネルスキャンをさせる
self.change_version_in_status("101")
\ No newline at end of file