mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-11-10 13:14:16 +00:00
replaces for with reduce for counting tracks
This commit is contained in:
parent
f5e06bbb2a
commit
6b740328fc
1 changed files with 1 additions and 4 deletions
|
@ -373,10 +373,7 @@ var MBImport = (function() {
|
|||
function searchParams(release) {
|
||||
let params = [];
|
||||
|
||||
let totaltracks = 0;
|
||||
for (let i = 0; i < release.discs.length; i++) {
|
||||
totaltracks += release.discs[i].tracks.length;
|
||||
}
|
||||
const totaltracks = release.discs.reduce((acc, { tracks }) => acc + tracks.length, 0);
|
||||
let release_artist = '';
|
||||
for (let i = 0; i < release.artist_credit.length; i++) {
|
||||
let ac = release.artist_credit[i];
|
||||
|
|
Loading…
Reference in a new issue