Skip to content

Commit

Permalink
Merge pull request #500 from Nottrex/patch-1
Browse files Browse the repository at this point in the history
Change SongSearch behaviour
  • Loading branch information
achimmihca authored Nov 6, 2024
2 parents af339af + 7bc069e commit 361ec46
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,14 @@ public List<SongMeta> GetFilteredSongMetas(List<SongMeta> songMetas)
string searchText = GetRawSearchText() != "#"
? GetSearchText()
: "";
if (searchText.IsNullOrEmpty()) {
return songMetas;
}
// Split searchText at whitespaces and match each word individually
string[] searchTexts = searchText.Split(new char[0], StringSplitOptions.RemoveEmptyEntries);
List<SongMeta> filteredSongs = songMetas
.Where(songMeta => searchText.IsNullOrEmpty()
|| SongMetaMatchesSearchedProperties(songMeta, searchText))
.Where(songMeta => searchTexts.IsNullOrEmpty()
|| searchTexts.AllMatch(searchWord => SongMetaMatchesSearchedProperties(songMeta, searchWord)))
.ToList();
return filteredSongs;
}
Expand Down

0 comments on commit 361ec46

Please sign in to comment.