-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflac.pl
executable file
·55 lines (38 loc) · 1.31 KB
/
flac.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /usr/bin/perl
#sudo apt-get install libcddb-get-perl
#sudo apt-get install libmp3-info-perl
#sudo apt-get install libmp3-tag-perl
#sudo apt-get install cdparanoia
#sudo apt-get install lame
use warnings;
use strict;
use RipRoutines
qw{get_cd_info fix_all_cd_info set_artist_dir set_album_dir set_flac_dir rip_album check_artist};
use File::Copy "cp";
use Cwd;
my $imageDir = '/home/robertm/Desktop';
opendir DIR, "$imageDir" or die "Can't open $imageDir $!";
my @images = grep { /\.(?:png|PNG|gif|GIF|jpg|JPG|jpeg|JPEG)$/i } readdir DIR;
closedir DIR;
my $count = 1;
foreach (@images) {
print "$count -- $_\n";
$count = $count + 1;
}
print "\n\n\n";
print "Which image:\n";
my $img_choice = <STDIN>;
print "$images[$img_choice - 1]\n";
system ("mv /home/robertm/Desktop/$images[$img_choice - 1] /home/robertm/Desktop/cover.jpg");
my %cd = get_cd_info();
my $album_artist = $cd{artist};
$cd{artist} = check_artist($cd{artist});
fix_all_cd_info(\%cd);
print ".............................. $album_artist <<<<<<<<<<<<<<<<<<<< album artist\n";
print ".............................. $cd{artist} <<<<<<<<<<<<<<<<<<<< artist\n";
print $cd{title}, "\n";
my $artist_dir = '';
my $flac_dir = set_flac_dir( $cd{artist}, $cd{title} );
print "\nFlac dir: $flac_dir\n\n";
rip_album( \%cd, $flac_dir, $album_artist);
exit(0);