comparison bin/ren @ 119:6a7305364793

Even more rules.
author Edho Prima Arief <edho@myconan.net>
date Fri, 21 Oct 2011 14:56:47 +0700
parents eb4dddd48f29
children 6d5ee629cd0b
comparison
equal deleted inserted replaced
118:131e1ddf8d43 119:6a7305364793
447 $newname =~ s/ +/ /g; 447 $newname =~ s/ +/ /g;
448 $newname =~ s/^ +//; 448 $newname =~ s/^ +//;
449 $newname =~ s/(- )+/- /; 449 $newname =~ s/(- )+/- /;
450 $newname =~ s/^\[N - F\]/[N-F]/; 450 $newname =~ s/^\[N - F\]/[N-F]/;
451 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/; 451 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/;
452 $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]/; 452 $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]/;
453 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /; 453 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /;
454 $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /;
454 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /; 455 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /;
455 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; 456 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname;
456 if ($_ eq $newname) { 457 if ($_ eq $newname) {
457 print("$_: no need to rename, skipping\n"); 458 print("$_: no need to rename, skipping\n");
458 } else { 459 } else {