OSDN Git Service

tunerec: include <unistd.h> for usleep
[rec10/rec10-git.git] / rec10 / dbMySQL.py
index 7c862e0..8a97de5 100644 (file)
@@ -1241,11 +1241,11 @@ vim         ")
             CREATE TABLE auto_classify \
             (\
             id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
-            title VARCHAR(1024),\
-            frompath VARCHAR(1024),\
-            topath VARCHAR(1024),\
+            title VARCHAR(100),\
+            frompath VARCHAR(400),\
+            topath VARCHAR(400),\
             do BOOLEAN,\
-            UNIQUE key (title),\
+            UNIQUE key (title)\
             )')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
@@ -1261,9 +1261,8 @@ vim         ")
     def delete_refresh_auto_classify(self):
         db = self.connect_db()
         db[1].execute("\
-        DROP TABLE auto_classify")
+        TRUNCATE TABLE auto_classify")
         self.close_db(db)
-        self.new_auto_classify()
     def delete_old_auto_classify(self, frompath):
         db = self.connect_db()
         db[1].execute("\
@@ -1281,10 +1280,7 @@ vim         ")
         if dbexe > 0:
             dls = db[1].fetchall()
         self.close_db(db)
-        if len(dls)>0:
-            return dls[0]
-        else:
-            return dls
+        return dls
     def update_db_to93(self):
         db = self.connect_db()
         self.drop_in_settings()