plugin dev - search.search_tracks_from_string queries

Asked by Grzegorz Lachowski

On exaile's wiki I found that I can search through collection using this:
tracks = [x.track for x in search.search_tracks_from_string(exaile.collection, ('artist=="%s"'%artist))]

I was wondering, if it is possible to use a little more complicated query e.g.
' artist=="%(artist)s" and album=="%(album)s" ' % locals()
or something like this
' artist=="%(artist)s" and ( "%(album)s"=="" or album=="%(album)s" )' % locals()
I wanted my plugin to add an album of a certain artist to playlist and sometimes, there is more than one album with the same name, but not the same artist.

Question information

Language:
English Edit question
Status:
Answered
For:
Exaile Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
reacocard (reacocard) said :
#1

Yes, you can use more-complex queries. The full search syntax is explained here: http://bazaar.launchpad.net/~exaile-devel/exaile/brainstorming/annotate/head:/design_docs/SEARCHING

Can you help with this problem?

Provide an answer of your own, or ask Grzegorz Lachowski for more information if necessary.

To post a message you must log in.