X-Git-Url: http://www.git.stargrave.org/?p=torn.git;a=blobdiff_plain;f=torn;h=36d8c8f10bee2e2b0eda96a315866f68481711db;hp=77d8d1b0b1ecfb54e1a0149e33e4f1c9e8f7a112;hb=HEAD;hpb=7b4fe78341e3e4508127dc9b7898f59a2215f393
diff --git a/torn b/torn
deleted file mode 100755
index 77d8d1b..0000000
--- a/torn
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/env perl
-# torn - Musical files renaming with russian language transliteration
-# Copyright (C) 2007-2020 Sergey Matveev (stargrave@stargrave.org)
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, version 3 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-=pod
-
-=head1 DESCRIPTION
-
-This Perl script takes directory file list and renames all files,
-making some substitution changes. It has some rules for musical
-files and rules to convert russian filenames to translit.
-
-=head1 USAGE
-
-Simply run this script in directory where you want files and/or
-directorires to be renamed.
-
-=head1 OVERVIEW
-
-=over 4
-
-=item * Transliterate everything
-
-=item * Replaces spaces with underscore
-
-=item * Downcase all extensions
-
-=item * "_-_" so good looking on the screen is replaced by single dash
-
-=item * Remove spaces before and after brackets
-
-=item * Remove "[]" brackets
-
-=item * Replace ampersand with "and" word
-
-=back
-
-=head1 AUTHOR
-
-Sergey Matveev L
-
-=cut
-
-use strict;
-use utf8;
-use Encode;
-
-binmode STDOUT, ":utf8";
-
-my $VERSION = "0.9";
-
-my $src;
-my $dst;
-my $src_filename;
-
-print "torn version $VERSION, Copyright (C) 2007-2020 Sergey Matveev
-torn comes with ABSOLUTELY NO WARRANTY. This is free software,
-and you are welcome to redistribute it under certain conditions.\n\n";
-
-opendir DIR, "." or die "Can not open directory\n";
-foreach (sort readdir DIR) {
- # Skip directory itself
- next if /^\.{1,2}$/;
-
- $src_filename = $_;
- $src = decode "utf-8", $src_filename;
- $dst = $src;
-
- # Basic corrections for music files
- $dst =~ s/ /_/g;
- $dst =~ s/_-_/-/g;
- $dst =~ s/_\(/\(/g;
- $dst =~ s/-\(/-/g;
- $dst =~ s/\)_/-/g;
- $dst =~ s/\,_/\,/g;
- $dst =~ s/\[//g;
- $dst =~ s/\]//g;
- $dst =~ s/\(_/\(/g;
- $dst =~ s/_\)/\)/g;
- $dst =~ s/\&/and/g;
-
- # Make translit
- $dst =~ y/абвгдеÑзийклмнопÑÑÑÑÑÑ
ÑÑÑÑÑ/abvgdeezijklmnoprstufhcjjye/;
- $dst =~ y/ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐРСТУФХЦЬЪЫÐ/ABVGDEEZIJKLMNOPRSTUFHCJJYE/;
- $dst =~ s/ж/zh/g;
- $dst =~ s/Ñ/ch/g;
- $dst =~ s/Ñ/sh/g;
- $dst =~ s/Ñ/sch/g;
- $dst =~ s/Ñ/ja/g;
- $dst =~ s/Ñ/ju/g;
- $dst =~ s/Ð/Zh/g;
- $dst =~ s/Ч/Ch/g;
- $dst =~ s/Ш/Sh/g;
- $dst =~ s/Щ/Sch/g;
- $dst =~ s/Я/Ja/g;
- $dst =~ s/Ю/Ju/g;
-
- # Lowercase file extensions
- if($dst =~ /^(.*)\.([^\.]+)$/){
- $dst = $1 . "." . lc $2;
- };
-
- # Change looking of track numbers
- # And renaming itself
- if($dst =~ /^(\d+)\-(.+)$/){
- print "$src -> $1.$2\n";
- rename $src_filename, "$1.$2";
- } else {
- print "$src -> $dst\n";
- rename $src_filename, $dst;
- };
-};
-closedir DIR;