clementine-player/Clementine — pull request #4118 by paperbagcorner (2014-01-14 00:23:49+00:00)
Title: Improve the handling of colons in library search

Currently when searching the library, you can limit your search to a specific field by prefixing "field:" to your search term, e.g artist:Queen.

The way clementine handles this is to prefix fts to each token which contains a colon. In the sql query, this translates to searching the specific column in the fts table. However, no check is made if the token is a valid column in this table. As documented in issue #925, searching for items that contain colons will therefore fail.

When searching manually in the library this is not much of a problem since you probably find the result before you have to type in the colon. However, if you use the recently merged "Show in library" feature (#4107), this sends a complete string at once to the search form. If this string contain colons, the search will fail.

The proposed solution is to prefix fts" only to tokens which are valid column names. All other colons are replaced with spaces.