changeset 118:131e1ddf8d43

Merge.
author Edho Prima Arief <edho@myconan.net>
date Fri, 21 Oct 2011 14:15:10 +0700
parents 66c32422a3d4 (diff) 548cf46e9cb4 (current diff)
children 6a7305364793 983beb13c736
files
diffstat 2 files changed, 44 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/bin/ren	Thu Oct 20 11:04:50 2011 +0700
+++ b/bin/ren	Fri Oct 21 14:15:10 2011 +0700
@@ -15,6 +15,11 @@
   $newname =~ s/\[UTW Mazui\]/[UTW-Mazui]/i;
   #TITLE AND NAMES
   $newname =~ s/^(\(|\[)W B(\)|\])/[W_B]/;
+  if ($newname =~ m/\[Doremi/) {
+    $newname =~ s/\.([a-z0-9]+)$/,$1/i;
+    $newname =~ s/\./ /g;
+    $newname =~ s/,([a-z0-9]+)$/.$1/i;
+  }
   $newname =~ s/^Genesis of Aquarion - (\d+) \[3xR\]\[Blu-ray.720p.H264.FLAC.AC3\](v2|)/[3xR] Genesis of Aquarion - $1 [$2 720p BD]/;
   $newname =~ s/^Otogi Zoshi Act\.(\d+)\[x264 AAC\]\[SSP-Corp\]/[SSP-Corp] Otogi Zoshi - $1 /;
   $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 /;
@@ -31,6 +36,7 @@
   $newname =~ s/\] *Pocket Monsters - (\d+) - .*\[(H264 |)SUB\]/] Pokemon - $1 /i;
   $newname =~ s/\] Fafner - /] Soukyuu no Fafner - /;
   $newname =~ s/\] Mashiro iro symphony - /] Mashiro-iro Symphony - /i;
+  $newname =~ s/\] Shakugan no Shana III /] Shakugan no Shana Final /i;
   $newname =~ s/\] Boku Ha Tomodachi Ga Sukunai - /] Boku wa Tomodachi ga Sukunai - /i;
   $newname =~ s/\] Seikon no Qwaser II BD - (\d+) \[720p\]/] Seikon no Qwaser II - $1 [720p BD]/i;
   $newname =~ s/\] Seikon no Qwaser Picture Drama - (\d+) /] Seikon no Qwaser - Picture Drama $1 /i;
@@ -41,6 +47,8 @@
   $newname =~ s/\] Spiral - (\d+) .* \[640 x 480\]\[H\.264\]/] Spiral - $1 /;
   $newname =~ s/\] Mayo Chiki - / ] Mayo Chiki! - /i;
   $newname =~ s/\] Naruto Shippuden - /] Naruto Shippuuden - /i;
+  $newname =~ s/\] Maji de Watashi ni Koi Shinasai!! /] Maji de Watashi ni Koi Shinasai! /i;
+  $newname =~ s/\] Sei Juushi Bismarck /] Sei Juushi Bismark /i;
   $newname =~ s/\] Tamayura - hitotose - /] Tamayura ~hitotose~ - /i;
   $newname =~ s/^Arigatou\.Tsubasa\.Chronicles\.(|2\.)(\d{2})(|v2)\./[Arigatou] Tsubasa Chronicles $1 - $2$3/;
   $newname =~ s/^Niea\.Under\.Seven\.(\d+)\.\(Dual\.Audio\)\.XVID\.\[AM\]/[AM] Niea Under Seven - $1/;
@@ -57,6 +65,7 @@
   $newname =~ s/\[Keroro\]\.(\d+)\.\[Xvid\.mp3\]\./[Keroro] Keroro Gunsou - $1 /i;
   $newname =~ s/\[Keroro\] \.(\d+)\. \[\.mp3\] \. /[Keroro] Keroro Gunsou - $1 /i;
   $newname =~ s/\[WPP & T-N\]/[WPP T-N]/;
+  $newname =~ s/(\[Jumonji-Giri\]) *\[[A-Z0-9- ]+\]/$1/i;
   $newname =~ s/ Yuru Yuri / YuruYuri /i;
   $newname =~ s/ Clannad - After Story / Clannad After Story /i;
   $newname =~ s/ Manyuu Hikenchou - (\d+) ~DC~ / Manyuu Hikenchou - $1 [Uncut]/;
@@ -212,6 +221,7 @@
   $newname =~ s/ AIR / Air /;
   $newname =~ s/ Sister Princess Re Pure / Sister Princess Repure /;
   $newname =~ s/C:\\Users\\Gad\\Desktop\\yankee-megane\\Release\\//;
+  $newname =~ s/ Ep(\d+)/ $1/i;
   $newname =~ s/\(END\)/[End]/i;
   $newname =~ s/\(BD 1280x720 h264 JP.EN AAC\)/[720p BD]/i;
   $newname =~ s/\[Final\]//i;
@@ -244,6 +254,7 @@
   $newname =~ s/ ED(\d+[a-z]*)/ - Ending $1 /i;
   $newname =~ s/ OP(\d+[a-z]*)/ - Opening $1 /i;
   $newname =~ s/ ED / - Ending /;
+  $newname =~ s/ Clean (Opening|Ending) v2/ - $1 (Clean) [v2]/i;
   $newname =~ s/ Creditless Opening (\d+) / - Opening $1 (Clean) /i;
   $newname =~ s/ Ep(\d+) Creditless Ending / - Ending $1 (Clean) /i;
   $newname =~ s/ (NCED|Ending Clean) / - Ending (Clean) /i;
@@ -254,11 +265,12 @@
   $newname =~ s/ - - / - /g;
   $newname =~ s/ Ep / /ig;
   ##SLICED BREAD
-  $newname =~ s/(\(|\[) *(h264\.aac|hi10p|10bit|\d+th Release|x264\.aac|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 10bit)\]/[DVD 10bit]/i;
-  $newname =~ s/(\(|\[) *(DVD 704x480 H264 AC3|DVD 704x480|DVDRip\.Xvid\.864x480\.Vorbis|DVD H264 848x480|DVD 720x480|DVD H264 720x480|DVD, wmv, mp3) *(\)|\])/[DVD]/i;
-  $newname =~ s/(\(|\[) *(BD 1080p Hi10P|BDRip 1080p x264 FLAC|BD-1080p-|BD-1080p-FLAC|1920x1038 Blu-Ray FLAC|1920x1080 Blu-Ray FLAC|1920x1080 h264 BD FLAC|1920x1080 BD|BD\.1080p\.FLAC|BD 1080p H\.264 AAC 5\.1|BD 1080p) *(\)|\])/[1080p BD]/i;
-  $newname =~ s/(\(|\[) *(1280x720 Hi10P|1280x720 5\.1|1280x720 x264 AAC|1280x720 H264 AAC|720p H264 AAC|1280x720|1280x720 H\.?264 AAC) *(\)|\])/[720p]/i;
+  $newname =~ s/(\(|\[) *(10bit-v2) *(\)|\])/[v2]/i;
+  $newname =~ s/(\(|\[) *(10-?bit|10bit 480p H264|640x360|640x360 H264 AAC|h264\.aac|hi10p|10bit|\d+th Release|x264\.aac|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 10bit)\]/[DVD]/i;
+  $newname =~ s/(\(|\[) *(DVD H264 720x480 AAC|DVD 704x480 H264 AC3|DVD 704x480|DVDRip\.Xvid\.864x480\.Vorbis|DVD H264 848x480|DVD 720x480|DVD H264 720x480|DVD, wmv, mp3) *(\)|\])/[DVD]/i;
+  $newname =~ s/(\(|\[) *(BD\]\[1080p-FLAC|1920x1080 Hi10p h264 AAC|BD 1920x1080 x264 AAC|BD 1080p Hi10P|BDRip 1080p x264 FLAC|BD-1080p-|BD-1080p-FLAC|1920x1038 Blu-Ray FLAC|1920x1080 Blu-Ray FLAC|1920x1080 h264 BD FLAC|1920x1080 BD|BD\.1080p\.FLAC|BD 1080p H\.264 AAC 5\.1|BD 1080p) *(\)|\])/[1080p BD]/i;
+  $newname =~ s/(\(|\[) *(Hi10P 1280x720 H264|Hi10P 1280x720|1280x720 Hi10P|1280x720 5\.1|1280x720 x264 AAC|1280x720 H264 AAC|720p H264 AAC|1280x720|1280x720 H\.?264 AAC) *(\)|\])/[720p]/i;
   $newname =~ s/(\(|\[) *(BD, 720p,|BD 720p H264-AAC|BDRip 720p|BD, 720p, ,|1280x720 BD|BD 1280x720 H264 AAC|BD 720p|BD 720p FLAC|BD 1280x720 H264 AAC) *(\)|\])/[720p BD]/i;
   $newname =~ s/(\(|\[) *(1024x576|H264 1024x576) *(\)|\])/[576p]/i;
   $newname =~ s/(\(|\[) *(1920x1080) *(\)|\])/[1080p]/i;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/rmcrc	Fri Oct 21 14:15:10 2011 +0700
@@ -0,0 +1,27 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+use File::Basename;
+
+my @files = @ARGV or print("Usage: ",basename($0)," file1 ... fileN\n") && exit(1);
+my $skip=0;
+foreach (@files) {
+  print(qq(Could not find file "$_", skipping\n)) and next() unless -e $_;
+  my $newname = $_;
+  $newname =~ s/\[[[:xdigit:]]{8}\]//i;
+  $newname =~ s/ *(\.\w+)$/$1/;
+  print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname;
+  if ($_ eq $newname) {
+    print("$_: no need to rename, skipping\n");
+  } else {
+    if($skip==1) { print("Result: $_ --> $newname\n"); }
+    else {
+      if(rename($_, $newname)) { print("$_ -> $newname\n"); }
+      else { print("$_: rename failed\n"); }
+    }
+  }
+  next();
+}
+
+exit(0);