diff --git a/docs/plugins/datequery.rst b/docs/plugins/datequery.rst deleted file mode 100644 index bb04228f2..000000000 --- a/docs/plugins/datequery.rst +++ /dev/null @@ -1,29 +0,0 @@ -DateQuery Plugin -================ - -The ``datequery`` plugin enables date fields to be queried against date -instants or date intervals. - -Dates can be specified as year-month-day where only year is mandatory. - -Date intervals must have at least a start or an end. The endpoints are -separated by two dots. - -A field can be queried as a date by prefixing the date criteria by ``T``. - -Example command line queries:: - - # All albums added in the year 2008: - beet ls -a 'added:T2008' - - # All items added in the years 2008, 2009 and 2010 - beet ls 'added:T2008..2010' - - # All items added before the year 2010 - beet ls 'added:T..2009' - - # All items added in the interval [2008-12-01T00:00:00, 2009-10-12T00:00:00) - beet ls 'added:T2008-12..2009-10-11' - - # All items with a stored file modification time in the interval [2008-12-01T00:00:00, 2008-12-03T00:00:00) - beet ls 'mtime:T2008-12-01..2008-12-02' diff --git a/docs/plugins/index.rst b/docs/plugins/index.rst index 6eed7ab32..1637fafa4 100644 --- a/docs/plugins/index.rst +++ b/docs/plugins/index.rst @@ -122,7 +122,6 @@ Miscellaneous * :doc:`info`: Print music files' tags to the console. * :doc:`missing`: List missing tracks. * :doc:`duplicates`: List duplicate tracks or albums. -* :doc:`datequery`: Query date fields against date intervals or instants. .. _MPD: http://mpd.wikia.com/ .. _MPD clients: http://mpd.wikia.com/wiki/Clients diff --git a/docs/reference/query.rst b/docs/reference/query.rst index 578611269..8bacf824b 100644 --- a/docs/reference/query.rst +++ b/docs/reference/query.rst @@ -128,6 +128,41 @@ and this command finds MP3 files with bitrates of 128k or lower:: $ beet list format:MP3 bitrate:..128000 +Date and Date Range Queries +--------------------------- + +Date fields such as added and mtime can be queried against a date or a one- or +two-sided date interval. + +A date is be specified as ``year-month-day`` where only year is mandatory. + +Date intervals should have at least a start or an end. The endpoints are +separated by two dots (``..``). + +An example query for finding all albums added in the year 2008:: + + $ beet ls -a 'added:2008' + +Find all items added in the years 2008, 2009 and 2010:: + + $ beet ls 'added:2008..2010' + +Find all items added before the year 2010:: + + $ beet ls 'added:..2009' + +Find all items added in the interval +[2008-12-01T00:00:00, 2009-10-12T00:00:00):: + + $ beet ls 'added:2008-12..2009-10-11' + +Find all items with a stored file modification time in the interval +[2008-12-01T00:00:00, 2008-12-03T00:00:00):: + + $ beet ls 'mtime:2008-12-01..2008-12-02' + +Note that the interval ``..`` is also valid, but it simply means the interval +of all possible dates. Path Queries ------------