AIMP Forum
AIMP for Android => Предложения / Suggestions => Topic started by: Tenbob on February 03, 2023, 16:04:05
-
Hi. I'd like to suggest an improvement to make it easier to search for songs. At present everything you type in the search box is treated as a single literal string. It would be be easier to use if each word was treated as a separate search term linked by the AND function.
For example. I want to search for a song by the Beatles with Love in the title. If I put "Beatles Love" into the search box I get no results. With this enhancement it would search separately for each word and give hits for the following ...
- Beatles - Love Me Do
- Beatles - She Loves You
- Beatles - Can't Buy Me Love, etc.
This type of search is the default on several other music players. I hope you will consider implementing it, as I really like using AIMP on Android.
-
+1
If you don't mind, I repost it here :
the algorithm is pretty simple :
words = explode the search string with space delimiter " " ; it returns array/list of words
foreach (songs_indexed as song) {
matchedWords = 0;
foreach (words as word) {
if (word exist in song) { // regex test or whatever
matchedWords++;
}
}
if (matchedWords === words.length) {
push song or songs[i] in search results array
}
}
-
Ok, I will improve the search soon