python-mpd2 icon indicating copy to clipboard operation
python-mpd2 copied to clipboard

Support for "contains" find/search expression filter

Open kowalcj0 opened this issue 3 years ago • 0 comments

Hi,

Got a QQ: Does python-mpd2 support "contains" find/search expression filter? If if does, then it would be great to have an example of it somewhere in the docs or tests.

PS. The reason I asked about it, is because the "contains" filter can come it handy when looking for a track with partial track details.

Here's an example of how it works in mpc (I've compared an exact match query with a query that uses "contains" filter):

Given there's a track called "Chico Science & Nação Zumbi - Maracatu Atômico" in MPD DB
When client executes mpc with an exact match search: mpc search '((artist == "Chico Science") AND (title == "Maracatu Atômico"))'
Then the search returns no results
Given there's a track called "Chico Science & Nação Zumbi - Maracatu Atômico" in MPD DB
When client executes mpc with a contains filter search: mpc search '((artist contains "Chico Science") AND (title contains "Maracatu Atômico"))'
Then the search returns 1 matching track: "Chico Science & Nação Zumbi - Maracatu Atômico"

Thanks

kowalcj0 avatar Jan 25 '22 23:01 kowalcj0