diff bin/ren @ 85:14435bd3f01c

Various rules.
author Edho Prima Arief <me@myconan.net>
date Sat, 09 Jul 2011 15:35:04 +0700
parents 34f193d5e7cd
children 4a22703b183c
line wrap: on
line diff
--- a/bin/ren	Wed Jun 22 08:03:46 2011 +0700
+++ b/bin/ren	Sat Jul 09 15:35:04 2011 +0700
@@ -20,12 +20,20 @@
   $newname =~ s/^\[ACX\]Fantastic Children - (\d+) .*/[ACX] Fantastic Children - $1.mkv/i;
   $newname =~ s/\[a-s\] sakigake!! cromartie high school - (\d+) - .* /[a-S] Sakigake!! Cromartie High School - $1 /;
   $newname =~ s/zx\.tenchi-universe\./[zx] Tenchi Universe - /;
+  $newname =~ s/\[Saizen & Shinsen-Subs\]/[Saizen-SHS]/i;
   $newname =~ s/ ro-kyu-bu! / Ro-Kyu-Bu! /i;
+  $newname =~ s/ Ore no Imouto ga Konna ni Kawaii Wake ga Nai / Ore no Imouto /i;
+  $newname =~ s/ no 6 / No. 6 /i;
+  $newname =~ s/ THE iDOLM\@STER / The iDOLM\@STER /i;
+  $newname =~ s/^- (\d+) - (\[neo1024\])/$2 Luping III S3 - $2/i;
+  $newname =~ s/ Luping III S3 / Lupin III S3 /i;
   $newname =~ s/( Transformers Headmasters - \d+) - .*\[/$1 [/i;
   $newname =~ s/^cor\.tv\.getbackers\.(\d+)\./[cor] GetBackers - $1 /;
   $newname =~ s/^cor\.extras\.getbackers\.(opening|ending)(\d+)\./[cor] GetBackers - $1 $2 /;
   $newname =~ s/^Revolutionary Girl Utena /[Henshin] Revolutionary Girl Utena /;
   $newname =~ s/His and Her Circumstances/His and Her Circumstances/i;
+  $newname =~ s/Magical Girl Madoka Magica/Puella Magi Madoka Magica/i;
+  $newname =~ s/ Pretty Rhythm Aurora Dream / Pretty Rhythm - Aurora Dream /i;
   $newname =~ s/(\[dvdrip\] Transformers \(1984\) -) E(\d+) .*(\.avi)/$1 $2 $3/;
   $newname =~ s/ Highschool of the Dead / High School of the Dead /i;
   $newname =~ s/LOGH Gaiden 2 E(\d+) .*(\.avi|\.mkv)/Legend of Galactic Heroes Gaiden 2 - $1$2/i;
@@ -34,7 +42,7 @@
   $newname =~ s/ Clannad - After Story - / Clannad After Story - /;
   $newname =~ s/^Mahoujin Guruguru TV2 - Doki Doki Densetsu Ep(\d+) \((Chamelenia)\)/[Chamelenia] Mahoujin Guruguru 2 - Doki Doki Densetsu - $1/i;
   $newname =~ s/\.divx5\.ogm$/.ogm/;
-  $newname =~ s/\[(neo1024)\] Lupin III - (\d+) - .+ \[/[$1] Lupin III S2 - $2 [/;
+  #$newname =~ s/\[(neo1024)\] Lupin III - (\d+) - .+ \[/[$1] Lupin III S2 - $2 [/;
   $newname =~ s/ Lupin S2 - / Lupin III S2 - /;
   $newname =~ s/ Prince of Tennis (\d+)/ Prince of Tennis - $1/i;
   $newname =~ s/ Boogiepop - / Boogiepop Phantom - /i;
@@ -100,7 +108,6 @@
   $newname =~ s/Les Miserables Shoujo Cosette /Les Miserables /;
   $newname =~ s/\[Elysium\]Baka\.to\.Test\.to\.Shoukanjuu\.(EP)?/[Elysium] Baka to Test to Shokanju/;
   $newname =~ s/\[Elysium\] Baka to Test to Shokanju/[Elysium] Baka to Test to Shokanju /;
-  $newname =~ s/\(BD\.1080p\.FLAC\)/[1080p BD]/;
   $newname =~ s/Saizen & SD/Saizen-SD/;
   $newname =~ s/Bleach - (\d{2}) /Bleach - 0$1 /;
   $newname =~ s/Omamori Himari - ED \(Clean\) - 0(\d) / Omamori Himari - Ending $1 (Clean) /;
@@ -172,19 +179,23 @@
   $newname =~ s/ ED(\d)/ - Ending $1 /;
   $newname =~ s/ OP(\d)/ - Opening $1 /;
   $newname =~ s/ ED / - Ending /;
-  $newname =~ s/ NCED / - Ending (Clean) /;
-  $newname =~ s/ NCOP / - Opening (Clean)/;
+  $newname =~ s/ NCED / - Ending (Clean) /i;
+  $newname =~ s/ NCED(\d+) / - Ending $1 (Clean) /i;
+  $newname =~ s/ NCOP / - Opening (Clean)/i;
   $newname =~ s/ OP / - Opening /;
   $newname =~ s/ - - / - /;
   $newname =~ s/ Ep / /ig;
   #GENERAL RULES
   $newname =~ s/\(1280x720 x264 AAC\)/[720p]/i;
-  $newname =~ s/\( *(1920x1080 h264 BD FLAC|1920x1080 BD) *\)/[1080p BD]/i;
+  $newname =~ s/\( *(1920x1038 Blu-Ray FLAC|1920x1080 h264 BD FLAC|1920x1080 BD) *\)/[1080p BD]/i;
+  $newname =~ s/\(BD\.1080p\.FLAC\)/[1080p BD]/;
   ##SLICED BREAD
   $newname =~ s/\[(\d+th Release|xvid|divx5\.2\.1|divx5\.1|divx5\.05|divx5\.1\.1|h\.?264 AC3|848x480|H264 848x480|h264-480p AAC|h\.264-480p)\]//i;
   $newname =~ s/\[(DVD 720x480|DVD H264 720x480)\]/[DVD]/i;
   $newname =~ s/\[(1280x720 H264 AAC)\]/[720p]/i;
   $newname =~ s/\[(BD 1280x720 H264 AAC)\]/[720p BD]/i;
+  $newname =~ s/\( *(BD 720p|BD 720p FLAC|BD 1280x720 H264 AAC) *\)/[720p BD]/i;
+  $newname =~ s/\( *(1280x720|1280x720 H\.?264 AAC) *\)/[720p]/i;
   ##SLICED BREAD pt.2
   $newname =~ s/(\d+)v(\d+)/$1 [v$2]/i;
   $newname =~ s/\[BD\]\[1920x1080 H264-Flac\]/[1080p BD]/i;
@@ -236,6 +247,8 @@
   $newname =~ s/\(1280x720\)/ [720p]/i;
   $newname =~ s/\(1920x1080\)/ [1080p]/i;
   $newname =~ s/\(1024x576\)/ [576p]/i;
+  $newname =~ s/\[1024x576\]/[576p]/i;
+  $newname =~ s/\[v(\d+) 1024x576\]/[v$1 576p]/i;
   $newname =~ s/\(1280x720 h264\)/ [720p]/i;
   $newname =~ s/\(1280x720 ?(h264|x264)?( aac)?\)/ [720p]/i;
   $newname =~ s/\(720p\)/[720p]/i;
@@ -350,7 +363,7 @@
   $newname =~ s/(- )+/- /;
   $newname =~ s/^\[N - F\]/[N-F]/;
   $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/;
-  $newname =~ s/^\[([\.\s\w\- ]+)\] (Ultraviolet Code 044|Gintama|Prince of Tennis|Lupin III S2|Kyou Kara Maou|Bleach|Naruto|One Piece|Detective Conan) - (Ending \d+|Opening \d+|Special \d+|\d+|\d+-\d+) /$2 - $3 [$1]/;
+  $newname =~ s/^\[([\.\s\w\- ]+)\] (Yawara|Ultraviolet Code 044|Gintama|Prince of Tennis|Lupin III S2|Kyou Kara Maou|Bleach|Naruto|One Piece|Detective Conan) - (Ending \d+|Opening \d+|Special \d+|\d+|\d+-\d+) /$2 - $3 [$1]/;
   $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /;
   $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /;
   print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname;