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:
c393041
)
classify : fix DB id undefined.
author
gn64_jp
<gn64@rec10.org>
Wed, 13 Nov 2013 03:50:37 +0000
(12:50 +0900)
committer
gn64_jp
<gn64@rec10.org>
Wed, 13 Nov 2013 03:50:37 +0000
(12:50 +0900)
rec10/classify.py
patch
|
blob
|
history
rec10/dbMySQL.py
patch
|
blob
|
history
diff --git
a/rec10/classify.py
b/rec10/classify.py
index
14183e1
..
110b748
100644
(file)
--- a/
rec10/classify.py
+++ b/
rec10/classify.py
@@
-91,7
+91,15
@@
if __name__ == "__main__":
if sf!="":
frompath = os.path.join(recpath, t + ".mp4")
topath = os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mp4")+".mp4")
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(frompath, topath)
+ rec10d.rec10db.add_auto_classify(t,frompath, topath)
+ dbl=rec10d.rec10db.select_move_auto_classify()
+ if len(dbl)>0:
+ for dbt in dbl:
+ title= dbt[1]
+ #frompath = dbt[1]
+ #topath = dbt[2]
+ #t=os.path.splitext(os.path.split(frompath)[1])[0]
+ auto_move.execMove(t, recpath, recordedpath,".mp4",1)
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
b73dd8c
..
9f37bf5
100644
(file)
--- a/
rec10/dbMySQL.py
+++ b/
rec10/dbMySQL.py
@@
-1241,6
+1241,7
@@
vim ")
CREATE TABLE auto_classify \
(\
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
CREATE TABLE auto_classify \
(\
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
+ title VARCHAR(1024),\
frompath VARCHAR(1024),\
topath VARCHAR(1024),\
do BOOLEAN\
frompath VARCHAR(1024),\
topath VARCHAR(1024),\
do BOOLEAN\
@@
-1248,13
+1249,13
@@
vim ")
except Exception, inst:
if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
recdblist.addCommonlogEX("Error", "new_auto_classify (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
except Exception, inst:
if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
recdblist.addCommonlogEX("Error", "new_auto_classify (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
- def add_auto_classify(self, frompath="", topath=""):
+ def add_auto_classify(self,
title="",
frompath="", topath=""):
db = self.connect_db()
db[1].execute('\
INSERT IGNORE into auto_classify \
db = self.connect_db()
db[1].execute('\
INSERT IGNORE into auto_classify \
- (frompath,topath,do) \
- values (%s,%s,0)', \
- (frompath, topath))
+ (
title,
frompath,topath,do) \
+ values (%s,%s,
%s,
0)', \
+ (
title,
frompath, topath))
self.close_db(db)
def delete_old_auto_classify(self, frompath):
db = self.connect_db()
self.close_db(db)
def delete_old_auto_classify(self, frompath):
db = self.connect_db()
@@
-1263,6
+1264,20
@@
vim ")
WHERE \
frompath == %s", (frompath))
self.close_db(db)
WHERE \
frompath == %s", (frompath))
self.close_db(db)
+ def select_move_auto_classify(self):
+ db = self.connect_db()
+ dbexe = db[1].execute("\
+ SELECT id,title,frompath,topath \
+ FROM auto_classify \
+ WHERE do = 1")
+ dls = []
+ if dbexe > 0:
+ dls = db[1].fetchall()
+ self.close_db(db)
+ if len(dls)>0:
+ return dls[0]
+ else:
+ return dls
def update_db_to93(self):
db = self.connect_db()
self.drop_in_settings()
def update_db_to93(self):
db = self.connect_db()
self.drop_in_settings()