Introduction
What is an extended playlist generator
The extended playlist generator is a component used to create, update and
manage playlists based on Database queries. It enables users to generate or
update playlists based on a certain set of filters that can be executed or
stored as presets and then called upon on a regular basis.
The Interface
Configure playlist query
The "Configure playlist query" window is used for creating the set of rules
that are used to generate the playlist(s) you want. It can either be used to
generate a single playlist directly, or to store various presets that can later
be used by the "Generate playlists" window.
Most of the fields in this
window should be rather self explanatory and I will go into more details on how
to create specific queries further down. In case you need some help on how to
create sort and display strings, please refer to the "Foobar2000 Titleformatting
help" in your main foobar2000 directory.
Generate playlists
The "Generate playlists dialog" is used to generate preconfigured playlists
from the added presets. Simply select as many playlists from the menu as you
would like to create and click the generate button. All playlists that are
selected will be either created or updated, depending on wether the "overwrite"
checkbox was enabled or disabled in the presets.
Configure Playlist Query
Query syntax
A new simplified syntax is used to create queries in the playlist generator
it is mainly based upon a few logical operators used for querying various
metadata fields:
Simple query
- "<any string>" - returns only items that have all words from
specified string in their metadata /tech info /file path.
Advanced Query
- "<field> HAS <string>" - Returns only items that have all
words from <string> in metadata field named <field>, e.g. title
HAS blah
- "<field> IS <string>" - Returns all items were (at least one)
metadata field <field> is equal to <string>, e.g. artist IS blah
- "<field> MISSING" - Returns only items with the <field>
missing (or empty).
- "* HAS <string>" - Same as simple search, but can be combined using
logical operators (see below).
Using logical operators
- "<pattern1> AND <pattern2>" - performs logical search
operation on two search patterns, e.g. "artist IS blah AND title HAS bleh" You
can also enclose patterns in parenthesis to control order of logical
operations, e.g. "(artist IS blah) AND (title HAS bleh)"
- "<pattern1> OR <pattern2>" - same as above, but with OR as
logical operation.
- "NOT <pattern> - inverts results of <pattern>:, e.g. "NOT
comment HAS sucks"
- "<field> GREATER <number>", "<field> LESS
<number>", "<field> EQUAL <number>" - performs integral
number comparison between <field> value and <number>, e.g.
Notes
- <field> and <string> in HAS/IS operations should be enclosed
in double quotation marks " if it includes spaces.
- If <field> in HAS/IS/GREATER/LESS/EQUAL includes at least one of #$%
characters, it will be treated as titleformatting string, e.g. ""%_codec%" IS
MP3". Using the titleformatting instead of simple field name will decrease
search speed and break multiple field handling in IS operator.
- All search operations are non case sensitive. All operators *must* be in
uppercase.
Examples
Just a few practical examples on different playlist queries
- artist IS a*
-Will create a playlist with all artists that start with
A.
- artist IS a* OR artist IS b* OR artist IS c* OR artist IS d*
-Will
generate a playlist with all artists starting with a,b,c,d
- genre IS jazz
-Will generate a playlist with all tracks where the genre
tag is Jazz
- genre HAS jazz
-Will generate a playlist with all tracks where the
genre contains the word Jazz, e.g. genre can also be "Jazzy" or
"Electronic/Jazz", etc.
- genre HAS electronic OR genre HAS dub OR genre HAS Trip
-Will generate
a Playlist where the genre contains either Electronic, Dub or Trip
- genre IS jazz AND (artist HAS Davis OR artist HAS Byrd)
-Will generate
a playlist where the genre is Jazz and the artist name contains either Byrd or
Davis
- genre IS Jazz AND date HAS 1976
-Will generate a playlist with all
items that are of the genre "jazz" and where the date field contains 1976.
(Note: By replacing 1976 with 197*, a playlist should be generated of all jazz
albums from 1970 to 1979.)
- genre HAS pop , combined with a sort spec of "$rand()"
-Will generate a
playlist in random order with all songs where the genre contains pop.
- (* HAS live) AND (NOT (* HAS BBC))
-Will generate a playlist with all
items that have Live in one of their metadata fields, but does not contain the
word BBC anywhere. (Note: replace * by the appropriate metadata field name in
case you want to limit your query to certain metadata fieds only.)
- __codec IS musepack
-Will generate a playlist of all tracks encoded in
musepack (mpc) format
- __bitrate EQUAL 192
-Will create a playlist that contains all files
with bitrates of exactly 192. (Note: you can replace EQUAL with GREATER or
LESS for the appropriate operations. Also you can combine the two above
strings as: "__codec IS mp3 AND __bitrate EQUAL 192". Might help you to
finally sort out those bad 192 kbps cbr scene rips that you wanted to send to
the recycle bin for such a long time already.)
- __replaygain_track_gain MISSING
-Will generate a playlist with all
items that have no track gain info. This can be used as an alternative to "NOT
__replaygain_track_gain IS *".
Ok that should give a basic idea of what is possible. Of course a lot more
can be done then just those few basic examples. Just let your imagination play a
bit to create what ever filters you like.
FAQ
"I don't get any results when searching the database!"
Go to
Preferences/Database and make sure that
Database enabled is
checked.
"The help command does not work!"
The HTML file has to be in the same
directory as the plugin.
Credits
Plugin written by tboehrer
Many thanks to Peter Pawlowski and the
Foobar2000 crew for providing the basic code and ideas for this
component.
Documentation written by picmixer.