Astroboy
view release on metacpan or search on metacpan
#
# Astroboy
# INSTALL
#
# make sure you have id3 tools installed (id3tag, id3info, etc)
yum -y install libid3tag
# make sure you have cpan deps
cpan Carp Cwd Exporter File::PathMP3::Tag Test::Simple
cpan File::PathInfo Getopt::Std::Strict LEOCHARRE::CLI LEOCHARRE::Class2 LEOCHARRE::DEBUG LEOCHARRE::Dir
cpan Smart::Comments
# install the perl part
perl Makefile.PL
make test
make install
# If you have any problems, contact Leo Charre leocharre at cpan dot org
Carp: 1
Cwd: 3
Exporter: 5
File::Path: 1.08
File::PathInfo: 1.25
File::Which: 0.05
Getopt::Std::Strict: 1.01
LEOCHARRE::Class2: 1.13
LEOCHARRE::DEBUG: 1.11
LEOCHARRE::Dir: 1.06
MP3::Tag: 0.9713
Smart::Comments: 1
Test::Simple: 0
distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.30
Makefile.PL view on Meta::CPAN
'Carp' => '1',
'Cwd' => '3',
'Exporter' => '5',
'File::Path' => '1.08',
'File::PathInfo' => '1.25',
'File::Which' => '0.05',
'Getopt::Std::Strict' => '1.01',
'LEOCHARRE::Class2' => '1.13',
'LEOCHARRE::DEBUG' => '1.11',
'LEOCHARRE::Dir' => '1.06',
'MP3::Tag' => '0.9713',
'Smart::Comments' => '1',
'Test::Simple' => '0',
},
LICENSE => 'perl',
EXE_FILES => [qw(bin/astroboy
bin/astroboy view on Meta::CPAN
#!/usr/bin/perl
use MP3::Tag;
use strict;
use vars qw(@FILES @ALBUM_DIRS @TRASH $ABS_MUSIC $VERSION);
use Astroboy;
use Getopt::Std::Strict 'a:tehdv';
use LEOCHARRE::Dir ':all';
$VERSION = sprintf "%d.%02d", q$Revision: 1.7 $ =~ /(\d+)/g;
INIT {
$opt_h and print usage() and exit;
$opt_v and print $VERSION and exit;
lib/Astroboy/AlbumFile.pm view on Meta::CPAN
package Astroboy::AlbumFile;
use strict;
use vars qw($VERSION);
use Carp;
$VERSION = sprintf "%d.%02d", q$Revision: 1.6 $ =~ /(\d+)/g;
use Carp;
use LEOCHARRE::Class2;
use Cwd;
use File::PathInfo;
use MP3::Tag;
use Astroboy::Base;
__PACKAGE__->make_accessor_setget(qw(t is_mp3 f abs_path filename_clean refile_overrite
title track artist album comment year genre filename));
sub new {
my $class = shift;
my $_abs = shift;
$_abs or croak("missing pathto file arg");
my $abs_path = Cwd::abs_path($_abs) or carp("cant abs_path to $_abs") and return;
lib/Astroboy/AlbumFile.pm view on Meta::CPAN
my $self = {
abs_path => $abs_path,
_f => $_f,
is_mp3 => (lc( $_f->ext ) eq 'mp3' ? 1 : 0),
filename => $_f->filename,
filename_clean => 0,
refile_overrite => 0,
};
if ($self->{is_mp3}){
$self->{t} = MP3::Tag->new($abs_path) or die;
debug("is mp3, got tag object");
my $info = $self->{t}->autoinfo;
for my $k (qw(title track artist album comment year genre)){
my $v = $info->{$k};
# clean up artist name
if ($k eq 'artist'){
$v = lc($v);
lib/Astroboy/AlbumFile.pm view on Meta::CPAN
Please note this is a package variable, so it affects all Astroboy objects.
=head1 METHODS PRIVATE
=head2 f()
Returns File::PathInfo object.
=head2 t()
Returns MP3::Tag object.
=head1 CAVEATS
This package is in development.
Do not use the api, use the cli.
Use the command line interface scripts for stability.
=head1 SEE ALSO
L<Astroboy>
( run in 1.101 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )