rec10 git
Revision | a8fa0e37d40e59fbdb495db0731290681d13c300 (tree) |
---|---|
Time | 2013-11-13 13:26:13 |
Author | gn64_jp <gn64@rec1...> |
Commiter | gn64_jp |
classify : fix DB.
@@ -85,13 +85,6 @@ if __name__ == "__main__": | ||
85 | 85 | recdblist.printutf8(u"×不明:"+t,verbose_level=100) |
86 | 86 | elif opts.rec10:##-r の場合 |
87 | 87 | # mkv無視します |
88 | - sa=auto_move.searchFile(recpath, recordedpath, ".mp4") | |
89 | - for t in sa: | |
90 | - sf=guess.searchFolder(t,recordedpath,200) | |
91 | - if sf!="": | |
92 | - frompath = os.path.join(recpath, t + ".mp4") | |
93 | - topath = os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mp4")+".mp4") | |
94 | - rec10d.rec10db.add_auto_classify(t,frompath, topath) | |
95 | 88 | dbl=rec10d.rec10db.select_move_auto_classify() |
96 | 89 | if len(dbl)>0: |
97 | 90 | for dbt in dbl: |
@@ -100,6 +93,14 @@ if __name__ == "__main__": | ||
100 | 93 | #topath = dbt[2] |
101 | 94 | #t=os.path.splitext(os.path.split(frompath)[1])[0] |
102 | 95 | auto_move.execMove(t, recpath, recordedpath,".mp4",1) |
96 | + rec10d.rec10db.delete_refresh_auto_classify() | |
97 | + sa=auto_move.searchFile(recpath, recordedpath, ".mp4") | |
98 | + for t in sa: | |
99 | + sf=guess.searchFolder(t,recordedpath,200) | |
100 | + if sf!="": | |
101 | + frompath = os.path.join(recpath, t + ".mp4") | |
102 | + topath = os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mp4")+".mp4") | |
103 | + rec10d.rec10db.add_auto_classify(t,frompath, topath) | |
103 | 104 | elif opts.delete:##-Dの場合 |
104 | 105 | sa=auto_move.searchFile(recpath, recordedpath,".mkv") |
105 | 106 | for t in sa: |
@@ -1244,7 +1244,8 @@ vim ") | ||
1244 | 1244 | title VARCHAR(1024),\ |
1245 | 1245 | frompath VARCHAR(1024),\ |
1246 | 1246 | topath VARCHAR(1024),\ |
1247 | - do BOOLEAN\ | |
1247 | + do BOOLEAN,\ | |
1248 | + UNIQUE key (title),\ | |
1248 | 1249 | )') |
1249 | 1250 | except Exception, inst: |
1250 | 1251 | if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)): |
@@ -1257,6 +1258,12 @@ vim ") | ||
1257 | 1258 | values (%s,%s,%s,0)', \ |
1258 | 1259 | (title,frompath, topath)) |
1259 | 1260 | self.close_db(db) |
1261 | + def delete_refresh_auto_classify(self): | |
1262 | + db = self.connect_db() | |
1263 | + db[1].execute("\ | |
1264 | + DROP TABLE auto_classify") | |
1265 | + self.close_db(db) | |
1266 | + self.new_auto_classify() | |
1260 | 1267 | def delete_old_auto_classify(self, frompath): |
1261 | 1268 | db = self.connect_db() |
1262 | 1269 | db[1].execute("\ |