Skip to content

Фильтр по регулярному выражению для исполнителя #79

Discussion options

You must be logged in to vote

В последних версиях исполнитель учитывается без дополнительных правок.

Старый ответ
Можно объединить вместе (трек, альбом, исполнитель). Также по инструкции добавив следующую функцию

// Строго: все части должны иметь кириллицу
Filter.matchAll = function (tracks, strRegex) {
    let regex = new RegExp(strRegex, 'i');
    let filteredTracks = tracks.filter((track) => {
        return regex.test(track.name.formatName()) && 
               regex.test(track.album.name.formatName()) &&
               regex.test(track.artists[0].name.formatName());
    });
    Combiner.replace(tracks, filteredTracks);
}

// Не строго: хотя бы где-то есть кириллица
Filter.matchAll = function (tracks, strRegex) {

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
1 reply
@Bondian
Comment options

Comment options

You must be logged in to vote
11 replies
@efremych
Comment options

@Chimildic
Comment options

@efremych
Comment options

@Chimildic
Comment options

@efremych
Comment options

Answer selected by Chimildic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants