Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. Trunc(str, len):=$repl(%str%, ".{" $len($repl(%str%, "(.?){" %len% "}$", "")) "}$", "")
  2. TruncEllipse(str, len):= { $len(%str%) = $len($Trunc(%str%, %len%)) ? %str% : $Trunc(%str%, %len%) "…" }
  3.  
  4. #AT:= { %ATe% ? %ATe% " (" %ATr% ")" : %ATr% } #anime title english for romanji
  5. AT:= { %ATe% ? %ATe% "" : %ATr% }
  6. ET:=[%ETe%,%ETr%]
  7. ET:=$TruncEllipse(%ET%,"64")
  8. GT:="[" [%GTs%,%GTl%] "]"
  9.  
  10. CRC:="["$uc(%FCrc%)"]"
  11. Src:="["%Source%"]" #set [source] e.g. [Blu-ray]
  12. Ver:={%Ver%="1"?"":"v"%Ver%} #set version if appliccable
  13. Res:="["%FVideoRes%"]" #set resolution e.g. [1280x720]
  14. Codec:="["$repl(%FVCodec%,"H264/AVC","h264")"]" #set video codec
  15.  
  16. TmpPad:=$max($len(%EpHiNo%),$len(%EpCount%)) # set minimum. There HAS to be an easier way but i stupid.
  17. EpNoPad:=$pad(%EpNo%,$max(%TmpPad%,'2'), "0")
  18. EpNoPad:=$repl(%EpNoPad%,'[sS]',"S00E0") #rename to "S00E"
  19.  
  20. MEpNo:={%ET%="Complete Movie"?%EpNoPad% %Ver%:%EpNoPad% %Ver%" - "%ET%} #Only show title when not "Complete Movie"
  21.  
  22. Movie := %AT%" - "%MEpNo%" - "%GT%%Src%%Res%%Codec%%CRC% #for movies set to
  23. Other := %AT%" - "%EpNoPad%%Ver%" - "%ET%" - "%GT%%Src%%Res%%Codec%%CRC% #all else set to
  24.  
  25. FileName:= {%Type% = "Movie"? %Movie% : %Other%} #check if the file is a movie or not and rename appropiately
  26. PathName:="E:\ProcessingAnime\" $repl(%AT%,'[\\":/*|<>?]',"")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement