diff --git a/bandcamp_importer.user.js b/bandcamp_importer.user.js index fa4d3a0..9cbab03 100644 --- a/bandcamp_importer.user.js +++ b/bandcamp_importer.user.js @@ -105,7 +105,7 @@ var BandcampImport = { // album description indicates number of tracks in the download var match = /^\d+ track album$/.exec($("meta[property='og:description']").attr("content")); if (match) { - numtracks = parseInt(match); + numtracks = parseInt(match, 10); } if (numtracks > 0 && numtracks > showntracks) { // display a warning if tracks in download differs from tracks shown diff --git a/cd1d_importer.user.js b/cd1d_importer.user.js index 2b8e254..24d9be1 100644 --- a/cd1d_importer.user.js +++ b/cd1d_importer.user.js @@ -67,7 +67,7 @@ var CD1DImporter = { // describes the first and second in the row. var duration = row.find('td.tracklist-content-length').text().replace('"', '').replace('\' ', ':').split( ':'); - duration = 60 * parseInt(duration[0]) + parseInt(duration[1]); // convert MM:SS to seconds + duration = 60 * parseInt(duration[0], 10) + parseInt(duration[1], 10); // convert MM:SS to seconds // drop track number prefix (A A2 C3 01 05 etc...) var title = row.find('td.tracklist-content-title').text().replace(/^[0-9A-F][0-9]* /, ''); @@ -164,9 +164,9 @@ var CD1DImporter = { .replace('December', '12') .split(' '); return { - 'year': parseInt(date[2]), - 'month': parseInt(date[1]), - 'day': parseInt(date[0]) + 'year': parseInt(date[2], 10), + 'month': parseInt(date[1], 10), + 'day': parseInt(date[0], 10) }; }, diff --git a/discogs_importer.user.js b/discogs_importer.user.js index bde5d63..f31d2fe 100644 --- a/discogs_importer.user.js +++ b/discogs_importer.user.js @@ -210,7 +210,7 @@ function hmsToSeconds(str) { var s = 0; var m = 1; while (t.length > 0) { - s += m * parseInt(t.pop()); + s += m * parseInt(t.pop(), 10); m *= 60; } return s; @@ -219,8 +219,8 @@ function hmsToSeconds(str) { // convert seconds to H:M:S or M:SS function secondsToHms(secs) { var sep = ':'; - var h = parseInt(secs/3600) % 24; - var m = parseInt(secs/60) % 60; + var h = parseInt(secs/3600, 10) % 24; + var m = parseInt(secs/60, 10) % 60; var s = secs % 60; var r = ""; if (h > 0) { diff --git a/encyclopedisque_importer.user.js b/encyclopedisque_importer.user.js index 60e1ad4..6ce2c7f 100644 --- a/encyclopedisque_importer.user.js +++ b/encyclopedisque_importer.user.js @@ -250,7 +250,7 @@ function parseEncyclopedisquePage() { } // Barcode ? - if (parseInt(release.year) <= 1982) { + if (parseInt(release.year, 10) <= 1982) { // FIXME: not working release.no_barcode = '1'; } diff --git a/lib/mblinks.js b/lib/mblinks.js index 7989415..61c87f5 100644 --- a/lib/mblinks.js +++ b/lib/mblinks.js @@ -56,7 +56,7 @@ var MBLinks = function (cachekey, expiration) { } }; this.cache = {}; - this.expirationMinutes = parseInt(expiration); + this.expirationMinutes = parseInt(expiration, 10); this.cache_key = cachekey; this.mb_server = '//musicbrainz.org'; // overrides link title and img src url (per type), see createMusicBrainzLink() diff --git a/mb_discids_detector.user.js b/mb_discids_detector.user.js index bbba5b2..ca40af4 100644 --- a/mb_discids_detector.user.js +++ b/mb_discids_detector.user.js @@ -246,7 +246,7 @@ var log_input_to_entries = function(text) { var m = toc_entry_matcher.exec(value); if (m) { // New disc - if (parseInt(m[1]) == 1) { + if (parseInt(m[1], 10) == 1) { if (entries.length > 0) { discs.push(entries); } entries = []; } @@ -272,7 +272,7 @@ var log_input_to_entries = function(text) { var get_layout_type = function(entries) { var type = "standard"; for (var i=0; i