File: types.rst

package info (click to toggle)
beets 2.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,988 kB
  • sloc: python: 46,429; javascript: 8,018; xml: 334; sh: 261; makefile: 125
file content (30 lines) | stat: -rw-r--r-- 878 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Types Plugin
============

The ``types`` plugin lets you declare types for attributes you use in your
library. For example, you can declare that a ``rating`` field is numeric so that
you can query it with ranges---which isn't possible when the field is considered
a string (the default).

Enable the ``types`` plugin as described in :doc:`/plugins/index` and then add a
``types`` section to your :doc:`configuration file </reference/config>`. The
configuration section should map field name to one of ``int``, ``float``,
``bool``, or ``date``.

Here's an example:

::

    types:
        rating: int

Now you can assign numeric ratings to tracks and albums and use :ref:`range
queries <numericquery>` to filter them.:

::

    beet modify "My favorite track" rating=5
    beet ls rating:4..5

    beet modify --album "My favorite album" rating=5
    beet ls --album rating:4..5