Skip to content

Commit 54747d4

Browse files
committed
Account for international Audible release dates.
1 parent 67485d4 commit 54747d4

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/extractors/amazon.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const includedLabels = [
55
'Contributors',
66
'Publisher',
77
'Publication date',
8-
'Audible.com Release Date',
98
'Program Type',
109
'Language',
1110
'Print length',
@@ -123,15 +122,10 @@ function getAudibleDetails() {
123122
return;
124123
}
125124

126-
// logMarian(label, includedLabels.includes(label));
127-
// Print debug info for labels not included
128-
// skip if not included in the list
129-
if (!includedLabels.includes(label)) {
130-
// logMarian(`Label not currently included: "${label}"`);
131-
return;
132-
}
133-
134-
if (label === 'Audible.com Release Date') {
125+
// Match any Audible.<TLD> Release Date
126+
if (/^Audible\.[a-z]{2,3} Release Date$/i.test(label)) {
127+
details['Publication date'] = value;
128+
} else if (label === 'Audible.com Release Date') {
135129
details['Publication date'] = value;
136130
} else if (label === 'Program Type') {
137131
details['Reading Format'] = value;

0 commit comments

Comments
 (0)