• R/O
  • HTTP
  • SSH
  • HTTPS

rec10-git: Commit

rec10 git


Commit MetaInfo

Revisiona8fa0e37d40e59fbdb495db0731290681d13c300 (tree)
Time2013-11-13 13:26:13
Authorgn64_jp <gn64@rec1...>
Commitergn64_jp

Log Message

classify : fix DB.

Change Summary

Incremental Difference

--- a/rec10/classify.py
+++ b/rec10/classify.py
@@ -85,13 +85,6 @@ if __name__ == "__main__":
8585 recdblist.printutf8(u"×不明:"+t,verbose_level=100)
8686 elif opts.rec10:##-r の場合
8787 # 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)
9588 dbl=rec10d.rec10db.select_move_auto_classify()
9689 if len(dbl)>0:
9790 for dbt in dbl:
@@ -100,6 +93,14 @@ if __name__ == "__main__":
10093 #topath = dbt[2]
10194 #t=os.path.splitext(os.path.split(frompath)[1])[0]
10295 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)
103104 elif opts.delete:##-Dの場合
104105 sa=auto_move.searchFile(recpath, recordedpath,".mkv")
105106 for t in sa:
--- a/rec10/dbMySQL.py
+++ b/rec10/dbMySQL.py
@@ -1244,7 +1244,8 @@ vim ")
12441244 title VARCHAR(1024),\
12451245 frompath VARCHAR(1024),\
12461246 topath VARCHAR(1024),\
1247- do BOOLEAN\
1247+ do BOOLEAN,\
1248+ UNIQUE key (title),\
12481249 )')
12491250 except Exception, inst:
12501251 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
@@ -1257,6 +1258,12 @@ vim ")
12571258 values (%s,%s,%s,0)', \
12581259 (title,frompath, topath))
12591260 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()
12601267 def delete_old_auto_classify(self, frompath):
12611268 db = self.connect_db()
12621269 db[1].execute("\
Show on old repository browser