Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 57 lines (48 sloc) 1.122 kb
#!/usr/bin/perl
use strict;
use File::Lscolor qw(ls_color);
use Term::ExtendedColor qw(fg);
my @disks = qw(
Mvids
Mvids_2
);
my %foo = %{ find(@ARGV) };
my $i = 1;
my $prev_chr;
for my $movie(sort(keys(%foo))) {
my($chr) = $movie =~ /(.)/;
$chr = '#' if $chr =~ /^\d+$/;
if($prev_chr ne $chr) {
printf(" %s\n", fg('bold', fg('red1', $chr)));
$prev_chr = $chr;
}
my($movie_disk_no) = $foo{$movie} =~ /(\d+)$/;
$movie_disk_no += 8;
printf("% 5d: %33s [ %s ]\n",
$i, fg("yellow$movie_disk_no", $foo{$movie}),
(-f "$foo{$movie}/$movie") ? ls_color($movie) : fg('blue4', $movie),
);
$i++;
}
sub find {
my $term = shift;
if(!defined($term)) {
my(undef, undef, undef, undef, undef, $year) = localtime(time);
$year += 1900;
$term = $year;
}
my %results;
chdir('/mnt/') or die($!);
for my $disk(@disks) {
for my $movie(glob("$disk/*")) {
#next if ! -d $movie;
if($movie =~ s;(.+)/(.+)$;$2;) {
my $mountpoint = $1;
if($movie =~ /$term/i) {
$results{$movie} = $mountpoint;
}
}
}
}
return \%results;
}
Jump to Line
Something went wrong with that request. Please try again.