OSDN Git Service

fix logo import bugs.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Wed, 23 Feb 2011 15:49:05 +0000 (15:49 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Wed, 23 Feb 2011 15:49:05 +0000 (15:49 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@845 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/chdb.py
rec10/trunk/src/dbMySQL.py
rec10/trunk/src/install.py
rec10/trunk/src/scan_ch.py
rec10/trunk/src/tester.py
rec10/trunk/src/timerec.py
rec10/trunk/src/ts2epg.py

index bfea9a4..65133fa 100644 (file)
@@ -83,10 +83,19 @@ def updateLogo():
     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
index de26606..fdd775a 100644 (file)
@@ -297,6 +297,14 @@ class DB_MySQL:
         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("\
@@ -924,21 +932,21 @@ vim         ")
             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()
@@ -1266,9 +1274,9 @@ vim         ")
         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("\
@@ -1293,13 +1301,13 @@ vim         ")
         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)\
@@ -1307,5 +1315,7 @@ vim         ")
         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
index d10ec47..6fffa9f 100644 (file)
@@ -54,7 +54,7 @@ def install():
     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
index 1a6e751..60d8f7f 100644 (file)
@@ -17,6 +17,7 @@ import tv2ts
 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)
@@ -71,6 +72,7 @@ def searchCh():
     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")):
index f02acad..1264564 100644 (file)
@@ -35,6 +35,8 @@ import rec10d
 #import guess
 #import zenhan
 #import auto_process
+import chdb
+import epgdb
 import datetime
 import tv2mp4
 import ts2x264
@@ -44,5 +46,7 @@ recpath = "/home/ftpusr/ftp-tmp/Recording/"
 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
index a821e60..dff97a8 100644 (file)
@@ -41,7 +41,10 @@ def task():
             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()
@@ -75,6 +78,7 @@ def task():
             sys.exit()
     update = chdb.update()
     updatelogo = chdb.updateLogo()
+    updatelogo=[]
     if len(update) > 0:
         pid = os.fork()
         if pid != 0:
index 5f6a73d..43d911f 100644 (file)
@@ -45,7 +45,7 @@ def writeEpgXMLTime(pout, ch ,times,islogo=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