$ beet ls -f '$path' rating-
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.7/beet", line 11, in <module>
load_entry_point('beets==1.5.0', 'console_scripts', 'beet')()
File "/usr/lib/python3.7/site-packages/beets/ui/__init__.py", line 1267, in main
_raw_main(args)
File "/usr/lib/python3.7/site-packages/beets/ui/__init__.py", line 1254, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/usr/lib/python3.7/site-packages/beets/ui/commands.py", line 1072, in list_func
list_items(lib, decargs(args), opts.album)
File "/usr/lib/python3.7/site-packages/beets/ui/commands.py", line 1067, in list_items
for item in lib.items(query):
File "/usr/lib/python3.7/site-packages/beets/dbcore/db.py", line 701, in __iter__
objects = self.sort.sort(list(self._get_objects()))
File "/usr/lib/python3.7/site-packages/beets/dbcore/query.py", line 885, in sort
return sorted(objs, key=key, reverse=not self.ascending)
TypeError: '<' not supported between instances of 'float' and 'str'
So we should somehow gather or query them when sorting the objects.
Use case
I'm trying to use beets to sort by item rating:
Solution
There is already a TODO in the code for this issue:
beets/beets/dbcore/query.py
Line 875 in 0c033bd
I guess most - if not all - attribute fields already have a type specified (like the
acousticbrainz-plugin here: https://github.com/beetbox/beets/blob/master/beetsplug/acousticbrainz.py#L116).So we should somehow gather or query them when sorting the objects.