CDDB_get-2.23p1.patch
2.18 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
diff -Naur CDDB_get-2.23/CDDB_get.pm CDDB_get-2.23p1/CDDB_get.pm
--- CDDB_get-2.23/CDDB_get.pm 2003-09-07 15:49:27.000000000 +0000
+++ CDDB_get-2.23p1/CDDB_get.pm 2004-06-30 08:37:28.000000000 +0000
@@ -261,6 +261,7 @@
my $input = $config->{input};
my $multi = $config->{multi};
+ my $entry = $config->{entry} if (defined($config->{entry}));
$input = 0 if $multi;
print STDERR Dumper($config) if $debug;
@@ -426,7 +427,14 @@
}
}
} else {
- push @to_get,@list;
+ unless(defined($entry)) {
+ push @to_get,@list;
+ }
+ else {
+ if($entry-1 >= 0 && $entry-1 <= $#list) {
+ push @to_get,$list[$entry-1];
+ }
+ }
}
my $i=0;
diff -Naur CDDB_get-2.23/cddb.pl CDDB_get-2.23p1/cddb.pl
--- CDDB_get-2.23/cddb.pl 2003-08-16 19:01:49.000000000 +0000
+++ CDDB_get-2.23p1/cddb.pl 2004-06-30 08:33:03.000000000 +0000
@@ -27,12 +27,13 @@
use strict;
my %option = ();
-getopts("oghdtsiSfDlOFc:", \%option);
+getopts("oghdtsiSfDlOFe:c:", \%option);
if($option{h}) {
print "$0: gets CDDB info of a CD\n";
print " no argument - gets CDDB info of CD in your drive\n";
print " -c device (other than default device)\n";
+ print " -e which cddb-entry to use\n";
print " -o offline mode - just stores CD info\n";
print " -d output in xmcd format\n";
print " -s save in xmcd format\n";
@@ -81,11 +82,19 @@
$config{CD_DEVICE}=$option{c} if $option{c};
# user interaction welcome?
-
-$config{input}=1; # 1: ask user if more than one possibility
- # 0: no user interaction
-$config{multi}=0; # 1: do not ask user and get all of them
- # 0: just the first one
+if($option{e}) {
+ $config{entry}=$option{e};
+ $config{input}=0; # 1: ask user if more than one possibility
+ # 0: no user interaction
+ $config{multi}=0; # 1: do not ask user and get all of them
+ # 0: just the first one
+}
+else {
+ $config{input}=1; # 1: ask user if more than one possibility
+ # 0: no user interaction
+ $config{multi}=0; # 1: do not ask user and get all of them
+ # 0: just the first one
+}
my %db;