X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=rec10%2Fclassify.py;fp=rec10%2Fclassify.py;h=c8525ec51b2c99758ca686b05567d1fa82981b8f;hb=89b884b045b9befed18536a2a7d44bc1e29359ed;hp=a496f1b3a3c861920aba1a79130ef1eca67adf81;hpb=0d75d6d668b483567fa7cf86c3107ee41d06e831;p=rec10%2Frec10-git.git diff --git a/rec10/classify.py b/rec10/classify.py index a496f1b..c8525ec 100644 --- a/rec10/classify.py +++ b/rec10/classify.py @@ -12,6 +12,7 @@ import configreader import recdblist import auto_move import guess +import rec10d recordedpath=unicode(configreader.getConfPath("recorded"),'utf-8') recpath=unicode(configreader.getConfPath("recpath"),'utf-8') @@ -28,6 +29,7 @@ if __name__ == "__main__": parser.add_option("-T","--Tsmove",action="store_true",dest="tsmove",default=False,help="Ts auto move.") parser.add_option("-S","--SeriesNum",action="store",type="string",dest="seriespath",default="",metavar="TITLE",help="Search Series Number in the path.") parser.add_option("-m","--manual",action="store_true",dest="manual",default=False,help="manual classifying mode asking for y/n(not a test)") + parser.add_option("-r","--rec10",action="store_true",dest="rec10",default=False,help="save moving plan in SQL table") #parser.add_option("-f","--filenumlist",action="store_true",dest="filenumlist",default=False,help="Guess Program Number.") (opts,args)=parser.parse_args(sys.argv) @@ -81,6 +83,15 @@ if __name__ == "__main__": recdblist.printutf8(u"FIXME:not implemented",verbose_level=100) else: 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(frompath, topath) elif opts.delete:##-Dの場合 sa=auto_move.searchFile(recpath, recordedpath,".mkv") for t in sa: