Skip to content

Commit

Permalink
Багфикс removeArtists для массива исполнителей в mode = first
Browse files Browse the repository at this point in the history
  • Loading branch information
Chimildic committed Sep 16, 2021
1 parent ed8a86b commit d76dc57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library.js
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,9 @@ const Filter = (function () {

function removeArtists(original, removable, invert = false, mode = 'every') {
let artists = removable.map(item =>
mode == 'every' ? (item.artists || item) : (item.artists[0] || item)
item.artists
? mode == 'every' ? item.artists : item.artists[0]
: item
).flat(1);
let ids = artists.toObject((item) => item.id);
let filteredTracks = original.filter((item) => invert ^ !getArtistIds(item, mode).some(id => ids.hasOwnProperty(id)));
Expand Down

0 comments on commit d76dc57

Please sign in to comment.