Quantcast
Channel: MobileRead Forums
Viewing all articles
Browse latest Browse all 50080

Searching for custom column #rating with calibredb gives unkown sort field

$
0
0
Hi all,

I use a custom boolean/float column named **#rating** (so I can store half-star values) instead of Calibre’s built-in rating column. When I try to search and sort by that custom column from the command line with calibredb I get errors like:
  • "Unknown sort field: #rating"
  • "Unknown fields: #rating"

Examples:

This fails:

Code:

calibredb list --search '#rating:True' --fields=rating,title,authors --sort-by='#rating'
Unknown sort field: #rating

This also fails:
Code:

calibredb list --search '#rating:True' --fields=#rating,title,authors --sort-by=rating
Unknown fields: #rating

This works but is useless to me because it shows the built-in column (all None for my books):
Code:

calibredb list --search '#rating:True' --fields=rating,title,authors --sort-by=rating
What I want
  • Search for books that have a value in my custom **#rating** column.
  • List title/authors and the custom **#rating** value.
  • Sort the results by my custom **#rating** values (in descending order).

Notes / what I’ve tried
  • I’ve tried quoting the column name, with and without the leading hash, and with/without spaces.
  • I’ve tried using the GUI to confirm the custom column name and type — it exists and contains values (including halves like 3.5).
  • I suspect calibredb either doesn’t accept custom column names with a leading “#” for --sort-by, or it expects a different syntax for custom columns.

Is there a supported way to reference custom columns (including those starting with “#”) in calibredb --fields, --search and --sort-by? If so, what is the exact syntax?

Viewing all articles
Browse latest Browse all 50080

Latest Images

Trending Articles



Latest Images