Commit Graph
62 Commits
Author SHA1 Message Date
Šarūnas Nejus c7dc31fe29 Add a changelog note and a mention in queries.rst 2026-08-27 02:56:48 +01:00
TowyTowyandClaude 348b87dd3e Normalise reversed date ranges instead of crashing
A date range query whose start lies after its end, such as
`beet ls added:2024..2020`, crashed with an uncaught ValueError
raised by DateInterval's endpoint-order check:

    ValueError: start date 2024-01-01 00:00:00 is not before end date
    2021-01-01 00:00:00

Only InvalidQueryArgumentValueError is converted into a user-facing
InvalidQueryError by Library._get_results, so the plain ValueError
escaped all the way up as a traceback.

Rather than reporting an error, accept the range and swap its two
endpoints, so `added:2024..2020` means the same as `added:2020..2024`.

The swap lives in `DateInterval.from_periods`, which is the only place
where the two user-supplied endpoints are still available as `Period`
objects. Swapping further down, in `DateInterval.__init__`, would swap
the already-derived datetimes, and those are derived asymmetrically:
the start contributes `Period.date` while the end contributes
`Period.open_right_endpoint()`. For `2024..2020` that would yield
[2021-01-01, 2024-01-01), which excludes both 2020 and 2024 -- not the
interval the user asked for. Swapping the periods first yields
[2020-01-01, 2025-01-01), which is exactly `2020..2024`.

`DateInterval.__init__` keeps raising ValueError, since it remains the
invariant guard for callers constructing an interval from datetimes
directly, where there is no notion of the order the user typed.

The swap only triggers when the interval would otherwise be empty, so
partially overlapping mixed-precision ranges that are valid today, such
as `2000-06..2000`, are unaffected. Genuinely malformed input such as
`added:notadate` still raises InvalidQueryArgumentValueError from
`Period.parse` as before.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-30 12:36:04 +02:00
Šarūnas Nejus 8673ea9a4d Update docs 2026-04-11 13:02:42 +01:00
Šarūnas Nejus a867b961cc Migrate arranger -> arrangers 2026-04-05 09:15:23 +01:00
Šarūnas Nejus 85eaa447f0 Migrate composer -> composers 2026-04-05 09:15:23 +01:00
Šarūnas Nejus a8f14ced42 Update docs 2026-04-05 09:15:23 +01:00
Šarūnas Nejus f2e282a327 Update docs 2026-04-05 09:15:23 +01:00
Wouter2devries 6e4c7354ab Formatted docs again 2026-03-26 10:53:00 +01:00
Wouter2devries 6f61fe9a3b Updated missed has_images 2026-03-26 10:50:40 +01:00
Wouter2devries 6aaa89fd8d Fixed docs formatting 2026-03-26 10:04:40 +01:00
Wouter2devries 867d17e409 Changed has_images to has_cover_art
Per suggestion as this is what used everywhere else
2026-03-20 21:03:52 +01:00
Wouter2devries 1c30e67e03 Added Images query tests, docs and changelog 2026-03-20 14:48:23 +01:00
Šarūnas Nejus ae3a2e5729 Fix redirect URLs 2026-03-06 11:28:29 +00:00
Šarūnas Nejus ab5acaabb3 Reformat all docs using docstrfmt 2025-08-10 16:25:05 +01:00
Šarūnas Nejus 769dcdc88a Docs: fix linting issues 2025-08-10 16:16:02 +01:00
Šarūnas Nejus 981a61bd56 Add support for filtering relations 2024-06-21 15:05:29 +01:00
Šarūnas Nejus 2800a323a2 Revert "Make queries fast, filter all flexible attributes (#5240)"
This reverts commit 143b9202f3, reversing
changes made to 8508a57d77.
2024-06-19 21:51:44 +01:00
Šarūnas Nejus 2f80ff07e4 Add a changelog note and a mention in queries.rst 2024-06-16 23:44:07 +01:00
Jesse Bannon f72261e44f Add support for artists and albumartists multi-valued tags (#4743)
Adds the following fields with id3v2.4 multi-valued tag support to autotag:
    - artists, artists_sort, artists_credit
    - albumartists, albumartists_sort, albumartists_credit
    - mb_artistids, mb_albumartistids

MusicBrainz support to populate + write the above multi-valued tags by default. Can be toggled to use id3v2.3 or id3v2.4 tags via the existing beets configuration option `id3v23`.

Big thanks to @JOJ0, @OxygenCobalt, @arsaboo for testing + @sampsyo for the initial code review .
2023-09-09 09:46:26 +02:00
J0J0 Todos 6b06344662 Further improve playlist plugin docs
Incorporate wording suggestions and add links to query sections.
2022-11-29 08:27:35 +01:00
Adrian Sampson f71e503f6c Change the prefix for exact match queries
PR #4251 added exact match queries, which are great, but it was
subsequently pointed out that the `~` query prefix was already in use:
https://github.com/beetbox/beets/pull/4251#issuecomment-1069455483

So this changes the prefix from `~` to `=~`. A little longer, but
hopefully it makes the relationship to the similarly-new `=` prefix obvious.
2022-08-17 16:05:33 -07:00
Rob Crowell 6457532274 Add query prefixes :~ and := 2022-01-24 19:19:48 -08:00
FichteFoll aa31fea037 Update a lot of URLs to use HTTPS
*All* URLs were checked manually, but only once per domain!

I mostly concerned myself with URLs in documentation rather than source
code because the latter may or may not have impactful changes, while the
former should be straight forward.

Changes in addition to simply adding an s:

- changed pip and pypi references as their location has changed
- MPoD (iOS app) url redirects to Regelian, so I replaced those
- updated homebrew references

Notable observations:

- beets.io does have HTTPS set up properly (via gh-pages)
- beatport.py uses the old HTTP url for beatport
- as does lyrics.py for lyrics.wikia.com
- https://tomahawk-player.org/ expired long ago, but the http page
  redirects to https regardless
- none of the sourceforge subdomains have https (in 2019!)
2019-06-05 03:11:49 +02:00
Adrian Sampson b1b4272501 Refinements to the relative date docs 2017-06-16 11:11:12 -04:00
Adrian Sampson 690ed731d8 Move the relative date docs downward
It's important to introduce the .. syntax before we get here.
2017-06-16 11:07:24 -04:00
euri10 93f064f505 Renamed relative to relative_units
Changed the return in case of a relative date, by default precision is
to the second, aka 5
Removed old 'relative' precision that indeed isn't necessary anymore
Corrected doc according to current relative date format, no more @
2017-06-16 09:14:40 +02:00
euri10 6664b656f4 Merge branch 'relativedate'
Solved conflicts with upstream of new parse classmethod of DateQuery

# Conflicts:
#	beets/dbcore/query.py
2017-06-15 08:59:43 +02:00
Adrian Sampson 0a731484e2 Slight refinements to time query docs 2017-06-10 21:00:49 -04:00
discopatrick 95eeec937c Add docs for datetime queries 2017-06-01 13:11:40 +01:00
Adrian Sampson d22a257008 Main guide: clarify meaning of plain keyword query
Fixes #2463.
2017-03-01 20:22:30 -05:00
euri10 d2cd4c0f21 Change relative date's format to further simplify it
A relative date doesn't need to be prefixed by @ anymore.
The relative date pattern now displays named groups.
Digits have been change to [0-9] to avoid other digit characters.
Removed the @ character in tests.
Updated subsequent documentation.
2017-01-31 16:56:03 +01:00
euri10 f0aca5e0d3 Explain relative dates
The previous version wasn't user-friendly enough and too technical.
2017-01-30 09:06:26 +01:00
euri10 c9177f2b56 removed unrelated PR changes
corrected docs with correct example
added relative date usage to it
2017-01-29 14:38:25 +01:00
euri10 e4a7d37a6d implementing changes asked
corrected rst
fixed flake8 in test
2017-01-29 11:49:22 +01:00
euri10 8d054f3656 tests flake8 issues
added some doc
2017-01-28 21:40:26 +01:00
Gondlar 3ea9706f4e Clarify which fields are searched by default 2016-06-16 18:53:55 +02:00
Adrian Sampson 3855fa0766 Doc refinements for #1749 2015-12-12 17:33:23 -08:00
Diego Moreda 47ceb492dc Add docs note for custom-field sorting, fix typo
* Add note about ordering when sorting by custom-fields on query.rst.
* Fix typo on inline.rst.
2015-11-25 19:15:01 +01:00
Adrian Sampson fd2cacbc25 Minor docs refinements for #1728
- Use a marginally more realistic example in the changelog.
- The -- convention is actually not the purview of shells; it's just a de
  facto standard for command-line parsers. Fortunately, argparse supports it
  out of the box.
2015-11-20 10:07:29 -08:00
Diego Moreda 51bf6a1c9f Add documentation for NotQuery, cleanup
* Add changelog and query.rst documentation entries for the usage of negated
queries.
* Cleanup NotQuery class as suggested during code review (PEP conforming
docstring, clarification on empty clause match behaviour).
2015-11-20 18:06:22 +01:00
Adrian Sampson d29cc7b2c0 Refine docs for #1586 2015-10-07 16:36:12 -07:00
Malte Ried 5832e8730e Changed the documentation of the PathQueries to reflect the usage of the file system cas-sensitivity. 2015-09-11 20:38:53 +02:00
Adrian Sampson e360438977 Note about escaping regex arguments in shell
A la #1520.
2015-06-25 21:27:28 -07:00
Tom Jaspers 0302c44909 Docs & changelog for case insensitive sort 2015-04-18 10:27:56 +02:00
Adrian Sampson 6004da7c42 Expand changelog for "or" queries (#1423) 2015-04-16 19:34:20 -07:00
Tom Jaspers c98835709f Query documentation to include "or" operator 2015-04-16 09:44:49 +02:00
Bruno Cauet 8a71935a95 Document path detection update 2015-03-30 13:18:35 +02:00
Adrian Sampson eec8d5d2be Doc rewording for #1330 2015-03-01 17:09:36 -08:00
Bruno Cauet 83e34322e9 Update changelog & docs 2015-02-17 13:14:29 +01:00
Adrian Sampson 5f2ca0b75b Rename smartartist to artist/albumartist (#953)
This is basically always what you want, so now you can just use the name of
the field without "smart".
2014-09-16 14:53:16 -07:00