mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-14 12:22:26 +00:00
Update mbimport.js
i was already instanced when a few loops were attempting to recreate it. Changed those 'var' statements to 'let's to better scope them to just the applicable loops.
This commit is contained in:
parent
f30e6b6d5d
commit
7f212c141d
1 changed files with 4 additions and 4 deletions
|
@ -157,7 +157,7 @@ var MBImport = (function() {
|
||||||
buildArtistCreditsFormParameters(parameters, '', release.artist_credit);
|
buildArtistCreditsFormParameters(parameters, '', release.artist_credit);
|
||||||
|
|
||||||
if (release['secondary_types']) {
|
if (release['secondary_types']) {
|
||||||
for (var i = 0; i < release.secondary_types.length; i++) {
|
for (let i = 0; i < release.secondary_types.length; i++) {
|
||||||
appendParameter(parameters, 'type', release.secondary_types[i]);
|
appendParameter(parameters, 'type', release.secondary_types[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ var MBImport = (function() {
|
||||||
appendParameter(parameters, 'comment', release.comment);
|
appendParameter(parameters, 'comment', release.comment);
|
||||||
|
|
||||||
// Label + catnos
|
// Label + catnos
|
||||||
for (var i = 0; i < release.labels.length; i++) {
|
for (let i = 0; i < release.labels.length; i++) {
|
||||||
let label = release.labels[i];
|
let label = release.labels[i];
|
||||||
appendParameter(parameters, `labels.${i}.name`, label.name);
|
appendParameter(parameters, `labels.${i}.name`, label.name);
|
||||||
appendParameter(parameters, `labels.${i}.mbid`, label.mbid);
|
appendParameter(parameters, `labels.${i}.mbid`, label.mbid);
|
||||||
|
@ -208,7 +208,7 @@ var MBImport = (function() {
|
||||||
let total_tracks = 0;
|
let total_tracks = 0;
|
||||||
let total_tracks_with_duration = 0;
|
let total_tracks_with_duration = 0;
|
||||||
let total_duration = 0;
|
let total_duration = 0;
|
||||||
for (var i = 0; i < release.discs.length; i++) {
|
for (let i = 0; i < release.discs.length; i++) {
|
||||||
let disc = release.discs[i];
|
let disc = release.discs[i];
|
||||||
appendParameter(parameters, `mediums.${i}.format`, disc.format);
|
appendParameter(parameters, `mediums.${i}.format`, disc.format);
|
||||||
appendParameter(parameters, `mediums.${i}.name`, disc.title);
|
appendParameter(parameters, `mediums.${i}.name`, disc.title);
|
||||||
|
@ -382,7 +382,7 @@ var MBImport = (function() {
|
||||||
totaltracks += release.discs[i].tracks.length;
|
totaltracks += release.discs[i].tracks.length;
|
||||||
}
|
}
|
||||||
let release_artist = '';
|
let release_artist = '';
|
||||||
for (var i = 0; i < release.artist_credit.length; i++) {
|
for (let i = 0; i < release.artist_credit.length; i++) {
|
||||||
let ac = release.artist_credit[i];
|
let ac = release.artist_credit[i];
|
||||||
release_artist += ac.artist_name;
|
release_artist += ac.artist_name;
|
||||||
if (typeof ac.joinphrase != 'undefined' && ac.joinphrase != '') {
|
if (typeof ac.joinphrase != 'undefined' && ac.joinphrase != '') {
|
||||||
|
|
Loading…
Reference in a new issue