parser.add_option("-t","--tssearch",action="store_true",dest="tssearch",default=False,help="Ts move auto search")
parser.add_option("-T","--Tsmove",action="store_true",dest="tsmove",default=False,help="Ts auto move.")
(opts,args)=parser.parse_args(sys.argv)
- if opts.ltitle!="":
+ if opts.ltitle!="":##-sの場合
ltitle=unicode(opts.ltitle,'utf-8')
sf=guess.searchFolder(ltitle, recordedpath)
print "###MKV###"
print "###MP4###"
recdblist.printutf8(os.path.join(sf, auto_move.get_move_dest_path(ltitle,recpath,sf,".mp4")+".mp4"))
print "\n"
- elif opts.auto:
+ elif opts.auto:##-A の場合
sa=auto_move.search_file(recpath, recordedpath, ".mkv")
for t in sa:
recdblist.printutf8(u"自動推測実行中-MKV")
auto_move.execMove(t, recpath, recordedpath,".mp4",1)
else:
recdblist.printutf8(t+" can't find matching folder")
- elif opts.list:
+ elif opts.list:##-lの場合
sa=auto_move.search_file(recpath, recordedpath,".mkv")
for t in sa:
sf=guess.searchFolder(t,recordedpath)
auto_move.execMove(etitle,recpath, recordedpath,".mkv",1)
elif os.path.exists(os.path.join(recpath, etitle+".mp4")):
auto_move.execMove(etitle,recpath, recordedpath,".mp4",1)
- elif opts.tssearch:
+ elif opts.tssearch:## -tの場合
tsmovepath=""
try:
tsmovepath=unicode(configreader.getpath("ts_movepath"),'utf-8')
sa=auto_move.search_file(recpath, tsmovepath,".ts")
else:
recdblist.printutf8(u"ts_movepathが設定されていません。/etc/rec10.confを設定してください。")
- elif opts.tsmove:
+ elif opts.tsmove:##-Tの場合
tsmovepath=""
try:
tsmovepath=unicode(configreader.getpath("ts_movepath"),'utf-8')
import n_gram
import recdblist
import zenhan
+import auto_move
def detName(title,path):
tt=detNameType(title, path)
else:
cmpp=os.path.basename(dirp)
appp=os.path.dirname(dirp)
- p=n_gram.trigram(title,cmpp)
+ ntitle=auto_move.getTitle(title)
+ ncmpp=auto_move.getTitle(cmpp)
+ p=n_gram.trigram(ntitle,ncmpp)
if p>0:
ngram.append((p,appp))
ngram=list(set(ngram))