OSDN Git Service

implement seriesnum determinant system.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 14 May 2010 06:15:18 +0000 (06:15 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 14 May 2010 06:15:18 +0000 (06:15 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@597 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/classify.py
rec10/trunk/src/guess.py
rec10/trunk/src/readme.txt

index 2371b74..01b428c 100644 (file)
@@ -25,6 +25,7 @@ if __name__ == "__main__":
     parser.add_option("-l","--list",action="store_true",dest="list",default=False,help="File listing mode(test for -A)")
     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.")
+    parser.add_option("-S","--SeriesNum",action="store",type="string",dest="seriespath",default="",metavar="TITLE",help="Search Series Number in the path.")
     #parser.add_option("-f","--filenumlist",action="store_true",dest="filenumlist",default=False,help="Guess Program Number.")
 
     (opts,args)=parser.parse_args(sys.argv)
@@ -109,4 +110,7 @@ if __name__ == "__main__":
                     auto_move.execMove(t, recpath, tsmovepath,".ts",0)
             sa=auto_move.search_file(recpath, tsmovepath,".ts")
         else:
-            recdblist.printutf8(u"ts_movepathが設定されていません。/etc/rec10.confを設定してください。")
\ No newline at end of file
+            recdblist.printutf8(u"ts_movepathが設定されていません。/etc/rec10.confを設定してください。")
+    elif opts.seriespath!="":##-Sの場合
+        ss=guess.detSeriesNum(opts.seriespath)
+        print ss
index e8ae1a7..5e1f6ca 100644 (file)
@@ -1,3 +1,4 @@
+import os.path
 #!/usr/bin/python
 # coding: UTF-8
 # Rec10 TS Recording Tools
@@ -17,6 +18,18 @@ def detName(title,path):
     tt=detNameType(title, path)
     if tt['type']=="C"or tt['type']=="D":
         tt['num']=detNum(tt['title'],tt['folder'])
+def detSeriesNum(execpath):
+    files=os.listdir(execpath)
+    ss={}
+    for file in files:
+        ftitle=os.path.splitext(file)
+        fname=ftitle[0]
+        fname=zenhan.toHankaku(unicode(name))
+        st=detNameType(fname, execpath)['title']
+        if not len(ss[st])>0:
+            ss[st]=[]
+        ss[detNum(fname,execpath)]=ftitle
+    return ss
 def detNum(title,movepath):
     """
         #番組の話数を推測する。
@@ -39,7 +52,7 @@ def detNum(title,movepath):
                 ff.append([p1['num'],p1['title'],time1])
                 if maxnum<p1['num']+1:
                     maxnum=p1['num']+1
-    detMultiDeltaDays(ff)
+    return detMultiDeltaDays(ff)
 def detMultiDeltaDays(num_with_title_with_dates):
     maxnum=0
     for ft in num_with_title_with_dates:
@@ -113,6 +126,7 @@ def detNameType(title,path):
     path --search reflexively
     """
     recdblist.printutf8(title)
+    title=auto_move.getTitle(title)##titleから日時を除く
     #rA=re.compile(".+(?P<title>)#\d(?P<num>)\s[0,10]\z")
     rA=re.compile("(.+)#(\d*)\s*\Z")
     tA=rA.match(title)
index 590bf0d..cac20aa 100644 (file)
@@ -1,7 +1,7 @@
 ###########################################
 #     Rec10 for PT1                       #
 #                          Ver.0.9.5      #
-# 2010/05/02    Yukikaze                 #
+# 2010/05/12    Yukikaze                 #
 #  Copyright (C) 2009-2010 Yukikaze      #
 ###########################################
 
@@ -14,7 +14,7 @@ wine
 mencoder
 ffmpeg
 x264
-mp4box(mp4使用時)
+mp4box
 mkvmerge(mkv使用時)
 java(jre1.6で動作を確認)
 
@@ -70,6 +70,8 @@ yukikaze.jp@gmail.com
 b25自動削除機能の改善
 自動仕分け機能のアップデート
 Caption2Assやaac取り出しがうまくいかないときの自動復帰処理の実装
+バグ修正
+
 
 10/04/02 0.9.4 release
 バグ修正