Re: [Rhythmbox-devel] Rhythmbox Searches For "AND" vs "&"



On Tue, Aug 10, 2010 at 2:02 PM, Kyle Baker <kyleabaker gmail com> wrote:
> It recently came to my attention that searching for artists, albums,
> and/or titles in Rhythmbox has an annoying limitation. I'm unaware of
> how other media players (not only those found in Linux) handle this,
> but it occurred to me that there may be a simple solution. Even if
> other media players don't do this, it could still be a feature to
> contribute to ease of use.
>
> The problem:
> When I'm searching (as an example) for an artist such as "Angels &
> Airwaves" I usually tend to quickly type out the ampersand to "Angels
> and Airwaves". Rhythmbox won't find what I'm looking for when I type
> it out like this unless "and" just happens to be elsewhere in a songs
> meta-tags.

Since Rhythmbox searches on individual words rather than substrings,
you can just leave out the 'and' and it'll give you the results you
want.

So, one thing missing here is adequate documentation that describes
how searching works.

> Solution:
> What are some opinions on adding a conditional to interpret search
> input containing the "and" term as both "and" as well as "&" and vice
> versa? Basically, just make these two strings search interchangeably.
> There may be other examples similar to this that could also be fixed.

Rather than trying to work around ambiguities like this, I think it
might be more useful to add a list of stop words that are disregarded
for searching. I'm not sure when it would ever be useful to search for
'and' or 'the' or the like.

> The only immediate draw back that I can think of is that this extra
> condition would depend on the language in use on the system, however,
> wouldn't that also mean that the code for this could also be fluid
> enough to work with different languages depending on the lang files
> that Rhythmbox is loaded with?

One of the challenges with this sort of thing is that we mostly need
to consider the language that the user's music is in rather than the
language they use for their GNOME session, so it isn't always useful
to use localised strings.

> I'd be willing to look into a possible patch and submit something to
> be reviewed, but I'd first like to get some feedback on the general
> idea. If it seems like it would be useful/beneficial at all and if so,
> other ideas for possible ways to implement this?

I'm not sure what would be the best way to do this. Your idea seems
like it would be worth trying. It should be pretty easy to do, too -
in rb_search_fold() (in lib/rb-util.c), substitute 'and' for '&'
either before the conversion to UCS4, or during the loop that converts
to lowercase and drops punctuation characters.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]