dstpath=os.path.join(recpath,title+ext)
srcpath=os.path.join(temppath,title+ext)
if os.path.exists(dstpath):
- gmtime=time.gmtime(os.path.getmtime(srcpath))
- iff=""
- try:
- iff=u"("+configreader.getenv("iff")+u")_"
- if iff==u"()_":
- iff = u""
- except:
+ if not os.path.getsize(dstpath) == os.path.getsize(srcpath):
+ gmtime=time.gmtime(os.path.getmtime(srcpath))
iff=""
- title=title+u"_"+iff+time.strftime("%Y-%m-%dT%H-%M-%S",gmtime)
+ try:
+ iff=u"("+configreader.getenv("iff")+u")_"
+ if iff==u"()_":
+ iff = u""
+ except:
+ iff=""
+ title=title+u"_"+iff+time.strftime("%Y-%m-%dT%H-%M-%S",gmtime)
+ else:
+ recdblist.printutf8(u"同サイズのファイルが存在します")
+
return title
def get_delpath(temppath,title):
delpath=[os.path.join(temppath,title+".ts")]
sf=guess.searchFolder(title, recpath)
if sf!="":
destpath=os.path.join(sf,get_move_dest_path(title, temppath, sf, ext)+ext)
- recdblist.printutf8("moving now..")
- recdblist.printutf8(srcpath+" : "+destpath)
- print srcpath
- shutil.copy(srcpath, destpath)
- #shutil.copy(srcpath, destpath)
- if autodel==1:
- delpath=get_delpath(temppath, title)
- for dp in delpath:
- try:
- os.remove(dp)
- ""
- except:
- ""
\ No newline at end of file
+ if os.path.exists(destpath):
+ if os.path.getsize(destpath) == os.path.getsize(srcpath):
+ recdblist.printutf8(u"同名同サイズのファイルが存在します。")
+ else:
+ recdblist.printutf8("moving now..")
+ recdblist.printutf8(srcpath+" : "+destpath)
+ print srcpath
+ shutil.copy(srcpath, destpath)
+ #shutil.copy(srcpath, destpath)
+ if autodel==1:
+ delpath=get_delpath(temppath, title)
+ for dp in delpath:
+ try:
+ os.remove(dp)
+ ""
+ except:
+ ""
\ No newline at end of file
sf=guess.searchFolder(ltitle, recordedpath)
print "###MKV###"
recdblist.printutf8(os.path.join(sf, auto_move.get_move_dest_path(ltitle,recpath,sf,".mkv")+".mkv"))
+ print "\n"
print "###MP4###"
recdblist.printutf8(os.path.join(sf, auto_move.get_move_dest_path(ltitle,recpath,sf,".mp4")+".mp4"))
+ print "\n"
elif opts.auto:
sa=auto_move.search_file(recpath, recordedpath, ".mkv")
for t in sa:
sf=guess.searchFolder(t,tsmovepath,700)
if sf!="":
recdblist.printutf8(t+u" : "+os.path.join(sf, auto_move.get_move_dest_path(t, recpath,sf,".ts")+".ts"))
+ print "\n"
sa=auto_move.search_file(recpath, tsmovepath,".ts")
else:
recdblist.printutf8(u"ts_movepathが設定されていません。/etc/rec10.confを設定してください。")