| 22 |
use gdclient; |
use gdclient; |
| 23 |
|
|
| 24 |
my $action = shift; |
my $action = shift; |
| 25 |
|
my $hostname = 'siggi'; |
| 26 |
|
|
| 27 |
sub usage { |
sub usage { |
| 28 |
print "Usage: gdc.pl ripcd|ripstatus", "\n"; |
print "Usage: gdc.pl ripcd|ripstatus", "\n"; |
| 42 |
|
|
| 43 |
|
|
| 44 |
sub ripcd { |
sub ripcd { |
| 45 |
gd_connect("siggi"); |
gd_connect($hostname); |
| 46 |
|
|
| 47 |
# 1. check if cd is already in database (probably ripped?) |
# 1. check if cd is already in database (probably ripped?) |
| 48 |
if (my $check_cd = gd_command("chcd", undef, 1)) { |
print "-" x 60, "\n"; |
| 49 |
print "-" x 60, "\n"; |
print "Check CD: "; |
| 50 |
print "CD already ripped:", "\n", $check_cd, "\n"; |
my $check_cd; |
| 51 |
print "-" x 60, "\n"; |
if ($check_cd = gd_command("chcd", undef, 1)) { |
| 52 |
|
print "CD already ripped!"; |
| 53 |
} |
} |
| 54 |
|
print "\n"; |
| 55 |
|
print $check_cd, "\n"; |
| 56 |
|
print "-" x 60, "\n"; |
| 57 |
|
|
| 58 |
# TODO: parse $check_cd and propagate cddb-id to "lcddi", if desired |
# TODO: parse $check_cd and propagate cddb-id to "lcddi", if desired |
| 59 |
|
|
| 90 |
} |
} |
| 91 |
|
|
| 92 |
sub ripstatus { |
sub ripstatus { |
| 93 |
gd_connect("siggi"); |
gd_connect($hostname); |
| 94 |
|
|
| 95 |
while (1) { |
while (1) { |
| 96 |
my $status_rip = gd_command("grpst", undef, 1); |
my $status_rip = gd_command("grpst", undef, 1); |