comparison bin/ren @ 131:2c94b1e14592

Even more rules.
author Edho Prima Arief <edho@myconan.net>
date Mon, 31 Oct 2011 11:35:05 +0700
parents 0c3b473b9af7
children 53b39ca5a6ea cf328bd06078
comparison
equal deleted inserted replaced
130:70928bbbd6cb 131:2c94b1e14592
22 $newname =~ s/,([a-z0-9]+)$/.$1/i; 22 $newname =~ s/,([a-z0-9]+)$/.$1/i;
23 } 23 }
24 $newname =~ s/^Genesis of Aquarion - (\d+) \[3xR\]\[Blu-ray.720p.H264.FLAC.AC3\](v2|)/[3xR] Genesis of Aquarion - $1 [$2 720p BD]/; 24 $newname =~ s/^Genesis of Aquarion - (\d+) \[3xR\]\[Blu-ray.720p.H264.FLAC.AC3\](v2|)/[3xR] Genesis of Aquarion - $1 [$2 720p BD]/;
25 $newname =~ s/^Otogi Zoshi Act\.(\d+)\[x264 AAC\]\[SSP-Corp\]/[SSP-Corp] Otogi Zoshi - $1 /; 25 $newname =~ s/^Otogi Zoshi Act\.(\d+)\[x264 AAC\]\[SSP-Corp\]/[SSP-Corp] Otogi Zoshi - $1 /;
26 $newname =~ s/Onii-chan no Koto Nanka Zenzen Suki Janain Dakara ne!! - (\d+) \[Uncut\]/Onii-chan no Koto Nanka Zenzen Suki Janain Dakara ne!! - $1 /; 26 $newname =~ s/Onii-chan no Koto Nanka Zenzen Suki Janain Dakara ne!! - (\d+) \[Uncut\]/Onii-chan no Koto Nanka Zenzen Suki Janain Dakara ne!! - $1 /;
27 $newname =~ s/^(Ayashi no Ceres|Chikyuu Shoujo Arjuna|Futari wa Precure Splash Star) - (\d+)\[\d+\] - .*(\[DVD\])(\[[^]]+\])(\[[a-f0-9]{8}\]\.[^.]+)$/$4 $1 - $2 $3$5/i;
28 $newname =~ s/^(Futari wa Precure Splash Star) - (C\d+)\[\d+\] - .*(\[DVD\])(\[[^]]+\])(\[[a-f0-9]{8}\]\.[^.]+)$/$4 $1 - $2 $3$5/i;
29 $newname =~ s/^(Air Master|Black Jack Special|Cinderella Boy|Damekko Doubutsu|Crystal Blaze) - (\d+)\[\d+\] - .*(\[[^]]+\])(\[[a-f0-9]{8}\]\.[^.]+)$/$3 $1 - $2 $4/i;
27 $newname =~ s/^cor\.extras\.infinite\.ryvius\.textless\.opening(\d+)\./[cor] Infinite Ryvius - Opening $1 (Clean) /; 30 $newname =~ s/^cor\.extras\.infinite\.ryvius\.textless\.opening(\d+)\./[cor] Infinite Ryvius - Opening $1 (Clean) /;
28 $newname =~ s/^cor\.extras\.infinite\.ryvius\.textless\.ending(\d+)\./[cor] Infinite Ryvius - Ending $1 (Clean) /; 31 $newname =~ s/^cor\.extras\.infinite\.ryvius\.textless\.ending(\d+)\./[cor] Infinite Ryvius - Ending $1 (Clean) /;
29 $newname =~ s/^cor\.extras\.infinite\.ryvius\.art\.gallery\.and\.audio\.drama(\d+)\./[cor] Infinite Ryvius - Picture Drama $1 /; 32 $newname =~ s/^cor\.extras\.infinite\.ryvius\.art\.gallery\.and\.audio\.drama(\d+)\./[cor] Infinite Ryvius - Picture Drama $1 /;
30 $newname =~ s/^cor\.extras\.infinite\.ryvius\.ryvius\.vj\.mix(\d+)\./[cor] Infinite Ryvius - Ryvius VJ Mix $1 /; 33 $newname =~ s/^cor\.extras\.infinite\.ryvius\.ryvius\.vj\.mix(\d+)\./[cor] Infinite Ryvius - Ryvius VJ Mix $1 /;
31 $newname =~ s/^cor\.extras\.infinite\.ryvius\.ryvius\.illusion(\d+)\.mini-episode(\d+)\./[cor] Infinite Ryvius - Ryvius Illusion $1 - Mini Episode $2 /; 34 $newname =~ s/^cor\.extras\.infinite\.ryvius\.ryvius\.illusion(\d+)\.mini-episode(\d+)\./[cor] Infinite Ryvius - Ryvius Illusion $1 - Mini Episode $2 /;
66 $newname =~ s/\[TSuNDeRe\]Tsuyokiss\.(\d+)\./[Tsundere] Tsuyokiss - $1 /i; 69 $newname =~ s/\[TSuNDeRe\]Tsuyokiss\.(\d+)\./[Tsundere] Tsuyokiss - $1 /i;
67 $newname =~ s/\[RANDOMFAGGOTS\]/[Randomfaggots]/i; 70 $newname =~ s/\[RANDOMFAGGOTS\]/[Randomfaggots]/i;
68 $newname =~ s/\[Keroro\]\.(\d+)\.\[Xvid\.mp3\]\./[Keroro] Keroro Gunsou - $1 /i; 71 $newname =~ s/\[Keroro\]\.(\d+)\.\[Xvid\.mp3\]\./[Keroro] Keroro Gunsou - $1 /i;
69 $newname =~ s/\[Keroro\] \.(\d+)\. \[\.mp3\] \. /[Keroro] Keroro Gunsou - $1 /i; 72 $newname =~ s/\[Keroro\] \.(\d+)\. \[\.mp3\] \. /[Keroro] Keroro Gunsou - $1 /i;
70 $newname =~ s/\[WPP & T-N\]/[WPP T-N]/; 73 $newname =~ s/\[WPP & T-N\]/[WPP T-N]/;
71 $newname =~ s/(\[Jumonji-Giri\]) *\[[A-Z0-9- ]+\]/$1/i; 74 $newname =~ s/(\[Jumonji-Giri\]) *\[[^]]+\]/$1/i;
72 $newname =~ s/ Yuru Yuri / YuruYuri /i; 75 $newname =~ s/ Yuru Yuri / YuruYuri /i;
73 $newname =~ s/ Clannad - After Story / Clannad After Story /i; 76 $newname =~ s/ Clannad - After Story / Clannad After Story /i;
74 $newname =~ s/ Manyuu Hikenchou - (\d+) ~DC~ / Manyuu Hikenchou - $1 [Uncut]/; 77 $newname =~ s/ Manyuu Hikenchou - (\d+) ~DC~ / Manyuu Hikenchou - $1 [Uncut]/;
75 $newname =~ s/\[Elysium\]K-ON!!\.EP(\d+)\(BD\.1080p\.FLAC\)/[Elysium] K-ON!! - $1 [1080p BD]/i; 78 $newname =~ s/\[Elysium\]K-ON!!\.EP(\d+)\(BD\.1080p\.FLAC\)/[Elysium] K-ON!! - $1 [1080p BD]/i;
76 $newname =~ s/\[Elysium\]K-ON!!\.(ED|OP)(\d+)\(BD\.1080p\.FLAC\)/[Elysium] K-ON!! - $1 $2 [1080p BD]/i; 79 $newname =~ s/\[Elysium\]K-ON!!\.(ED|OP)(\d+)\(BD\.1080p\.FLAC\)/[Elysium] K-ON!! - $1 $2 [1080p BD]/i;
430 $newname =~ s/ Opening - / Opening /; 433 $newname =~ s/ Opening - / Opening /;
431 $newname =~ s/ Ending - / Ending /; 434 $newname =~ s/ Ending - / Ending /;
432 $newname =~ s/ Hidamari Sketch Hoshimittsu - Special / Hidamari Sketch Hoshimittsu Special - /; 435 $newname =~ s/ Hidamari Sketch Hoshimittsu - Special / Hidamari Sketch Hoshimittsu Special - /;
433 $newname =~ s/ Spice and Wolf S2 - BD Menu - 0/ Spice and Wolf S2 - BD Menu /; 436 $newname =~ s/ Spice and Wolf S2 - BD Menu - 0/ Spice and Wolf S2 - BD Menu /;
434 $newname =~ s/ Canvas - 2 - / Canvas 2 - /; 437 $newname =~ s/ Canvas - 2 - / Canvas 2 - /;
438 $newname =~ s/ To Heart - 2 / To Heart 2 /;
435 $newname =~ s/ Tsubasa Chronicles - 2 (\d{2}) / Tsubasa Chronicles 2 - $1 /; 439 $newname =~ s/ Tsubasa Chronicles - 2 (\d{2}) / Tsubasa Chronicles 2 - $1 /;
436 $newname =~ s/ Mitsudomoe - 2 - / Mitsudomoe 2 - /; 440 $newname =~ s/ Mitsudomoe - 2 - / Mitsudomoe 2 - /;
437 $newname =~ s/ Morita-san wa Mukuchi - 2 / Morita-san wa Mukuchi 2 /i; 441 $newname =~ s/ Morita-san wa Mukuchi - 2 / Morita-san wa Mukuchi 2 /i;
438 $newname =~ s/ Eyeshield - 21 - / Eyeshield 21 - /; 442 $newname =~ s/ Eyeshield - 21 - / Eyeshield 21 - /;
439 $newname =~ s/ - opening - (\d+) / - Opening $1 /i; 443 $newname =~ s/ - opening - (\d+) / - Opening $1 /i;
450 $newname =~ s/ +/ /g; 454 $newname =~ s/ +/ /g;
451 $newname =~ s/^ +//; 455 $newname =~ s/^ +//;
452 $newname =~ s/(- )+/- /; 456 $newname =~ s/(- )+/- /;
453 $newname =~ s/^\[N - F\]/[N-F]/; 457 $newname =~ s/^\[N - F\]/[N-F]/;
454 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/; 458 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/;
455 $newname =~ s/^\[([\.\s\w\- ]+)\] (Fairy Tail|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]/; 459 $newname =~ s/^\[([&!\.\s\w\- ]+)\] (Air Master|Crystal Blaze|Fairy Tail|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]/;
456 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /; 460 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /;
457 $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /; 461 $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /;
458 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /; 462 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /;
459 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; 463 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname;
460 if ($_ eq $newname) { 464 if ($_ eq $newname) {