OSDN Git Service
(root)
/
rec10
/
rec10-git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
64699e9
)
classify : fix DB.
author
gn64_jp
<gn64@rec10.org>
Wed, 13 Nov 2013 04:26:13 +0000
(13:26 +0900)
committer
gn64_jp
<gn64@rec10.org>
Wed, 13 Nov 2013 04:26:13 +0000
(13:26 +0900)
rec10/classify.py
patch
|
blob
|
history
rec10/dbMySQL.py
patch
|
blob
|
history
diff --git
a/rec10/classify.py
b/rec10/classify.py
index
110b748
..
1b82830
100644
(file)
--- a/
rec10/classify.py
+++ b/
rec10/classify.py
@@
-85,13
+85,6
@@
if __name__ == "__main__":
recdblist.printutf8(u"×不明:"+t,verbose_level=100)
elif opts.rec10:##-r の場合
# mkv無視します
recdblist.printutf8(u"×不明:"+t,verbose_level=100)
elif opts.rec10:##-r の場合
# mkv無視します
- sa=auto_move.searchFile(recpath, recordedpath, ".mp4")
- for t in sa:
- sf=guess.searchFolder(t,recordedpath,200)
- if sf!="":
- frompath = os.path.join(recpath, t + ".mp4")
- topath = os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mp4")+".mp4")
- rec10d.rec10db.add_auto_classify(t,frompath, topath)
dbl=rec10d.rec10db.select_move_auto_classify()
if len(dbl)>0:
for dbt in dbl:
dbl=rec10d.rec10db.select_move_auto_classify()
if len(dbl)>0:
for dbt in dbl:
@@
-100,6
+93,14
@@
if __name__ == "__main__":
#topath = dbt[2]
#t=os.path.splitext(os.path.split(frompath)[1])[0]
auto_move.execMove(t, recpath, recordedpath,".mp4",1)
#topath = dbt[2]
#t=os.path.splitext(os.path.split(frompath)[1])[0]
auto_move.execMove(t, recpath, recordedpath,".mp4",1)
+ rec10d.rec10db.delete_refresh_auto_classify()
+ sa=auto_move.searchFile(recpath, recordedpath, ".mp4")
+ for t in sa:
+ sf=guess.searchFolder(t,recordedpath,200)
+ if sf!="":
+ frompath = os.path.join(recpath, t + ".mp4")
+ topath = os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mp4")+".mp4")
+ rec10d.rec10db.add_auto_classify(t,frompath, topath)
elif opts.delete:##-Dの場合
sa=auto_move.searchFile(recpath, recordedpath,".mkv")
for t in sa:
elif opts.delete:##-Dの場合
sa=auto_move.searchFile(recpath, recordedpath,".mkv")
for t in sa:
diff --git
a/rec10/dbMySQL.py
b/rec10/dbMySQL.py
index
9f37bf5
..
7c862e0
100644
(file)
--- a/
rec10/dbMySQL.py
+++ b/
rec10/dbMySQL.py
@@
-1244,7
+1244,8
@@
vim ")
title VARCHAR(1024),\
frompath VARCHAR(1024),\
topath VARCHAR(1024),\
title VARCHAR(1024),\
frompath VARCHAR(1024),\
topath VARCHAR(1024),\
- do BOOLEAN\
+ do BOOLEAN,\
+ 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)):
)')
except Exception, inst:
if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
@@
-1257,6
+1258,12
@@
vim ")
values (%s,%s,%s,0)', \
(title,frompath, topath))
self.close_db(db)
values (%s,%s,%s,0)', \
(title,frompath, topath))
self.close_db(db)
+ def delete_refresh_auto_classify(self):
+ db = self.connect_db()
+ db[1].execute("\
+ DROP 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("\
def delete_old_auto_classify(self, frompath):
db = self.connect_db()
db[1].execute("\