05-19-2024, 03:59 PM | #1 |
Connoisseur
Posts: 62
Karma: 10
Join Date: Jan 2010
Device: Onyx Boox Poke 3
|
What would be the best/correct way do query for
I have a custom read/unread column.
I'm aware of calibredb, but not very familiar with it. What I tried to do was Code:
calibredb --library-path=/path/to/library list --fields "series,series_index" --search 'series:True series_index:1.0 #readstatus:"=Read"' --sort-by 'series' 1. The sort is reverse alphabetical (I want alphabetical) 2. The sort is done where "insignificant" words like "A" or "The" are disregarded (I want them included) 3. It still prints the ID, despite me not including it in --fields (I don't want the ID shown). I was able to handle this with a mixture of various Linux text processing tools like cut, sed, and sort, but ideally I wouldn't have to do this somehow? Once I get that down, I want to additionally select the MAX series index for each series, but I have no clue how I'd do that. Last edited by Trel; 05-19-2024 at 04:03 PM. |
05-19-2024, 08:36 PM | #2 |
Connoisseur
Posts: 95
Karma: 1133068
Join Date: Sep 2007
Device: ipaq
|
It won't get rid of the id, but try:
list --fields series,series_index --search "series:true and series_index:1.0 and #readstatus:Read" --sort-by series --ascending |
Advert | |
|
05-20-2024, 04:05 PM | #3 | |
Connoisseur
Posts: 62
Karma: 10
Join Date: Jan 2010
Device: Onyx Boox Poke 3
|
Quote:
That addresses the reverse sort, but it also breaks filtering on readstatus because "read" matches "read" and "unread", it's gotta be "=Read". It unfortunately doesn't help the issue with 'a' and 'the' not getting sorted alphabetically either. |
|
05-20-2024, 10:29 PM | #4 |
creator of calibre
Posts: 43,963
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you want to sort including leading articles create a custom column in the library that uses a template to generate the value of series. It will sort using the value as a simple string.
|
05-21-2024, 12:28 PM | #5 | |
Connoisseur
Posts: 95
Karma: 1133068
Join Date: Sep 2007
Device: ipaq
|
Quote:
Maybe a built-in Series Sort field similar to Author Sort and Title Sort would make sense and then allowing the user to sort by either the literal field or the sort field. Is there any way to suppress the output of the id field? |
|
Advert | |
|
05-21-2024, 12:52 PM | #6 | |
creator of calibre
Posts: 43,963
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
And no you cannot suppress ids without them you can get duplicate rows. If you want full control use --for-machine which will output json and then postp process however you like using a tool such as jq or similar. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Query re editor | johngross | Editor | 0 | 10-07-2019 04:46 PM |
meaning and how to correct | ralphiedee | Sigil | 4 | 10-17-2012 03:48 PM |
Metadata query | iain robinson | ePub | 4 | 08-08-2012 12:07 PM |
Hello and query | MPDuke | Introduce Yourself | 8 | 12-13-2011 10:27 AM |
Query - Kindle DX US | ukhant | Kindle Developer's Corner | 2 | 07-20-2010 03:23 AM |