mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2025-03-04 22:37:16 +00:00
Qobuz importer: improve handling of featured artists
This commit is contained in:
parent
8205d46fd8
commit
c3327d7f94
1 changed files with 12 additions and 2 deletions
|
@ -75,17 +75,27 @@ function parseRelease(data) {
|
|||
return [name, list];
|
||||
});
|
||||
var artists = [];
|
||||
var featured_artists = [];
|
||||
$.each(performers, function(index, performer) {
|
||||
if ($.inArray('Main Performer', performer[1]) != -1
|
||||
if ($.inArray('Featured Artist', performer[1]) != -1) {
|
||||
featured_artists.push(performer[0]);
|
||||
}
|
||||
else if ($.inArray('Main Performer', performer[1]) != -1
|
||||
|| $.inArray('Primary', performer[1]) != -1
|
||||
|| $.inArray('interprète', performer[1]) != -1
|
||||
|| $.inArray('Performer', performer[1]) != -1
|
||||
|| $.inArray('Main Artist', performer[1]) != -1
|
||||
|| $.inArray('Featured Artist', performer[1]) != -1) {
|
||||
) {
|
||||
artists.push(performer[0]);
|
||||
}
|
||||
});
|
||||
track.artist_credit = MBImport.makeArtistCredits(artists);
|
||||
if (featured_artists.length) {
|
||||
if (track.artist_credit.length) {
|
||||
track.artist_credit[track.artist_credit.length-1].joinphrase = ' feat. ';
|
||||
}
|
||||
$.merge(track.artist_credit, MBImport.makeArtistCredits(featured_artists));
|
||||
}
|
||||
tracks.push(track);
|
||||
});
|
||||
release.discs = [];
|
||||
|
|
Loading…
Add table
Reference in a new issue