|
|
#1 |
|
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Mar 2008
Device: HTC-p3000
|
calibredb exception
Hi,
I'm writing a tool to automate lib management & transfer between different databases (BookCAT, in my case). As directed I'm using calibredb to interact with Calibre database. Basic creation of books in Calibre works To handle updating I need to query what books are already there and their ID. To have a better matching I wanted to use optional fields (e.g.: ISBN), but it seems calibredb chokes when one requested field is empty. Code:
$ calibredb list --separator='|' --fields=title,authors,isbn id|title |authors |isbn| Traceback (most recent call last): File "site.py", line 58, in main File "site-packages/calibre/library/cli.py", line 1475, in main File "site-packages/calibre/library/cli.py", line 221, in command_list File "site-packages/calibre/library/cli.py", line 138, in do_list File "textwrap.py", line 329, in wrap File "textwrap.py", line 258, in _wrap_chunks ValueError: invalid width 0 (must be > 0) $ calibredb list --separator='|' --fields=title,authors id|title |authors | 1|Calibre Quick Start Guide|John Schember| I'm currently using "calibredb (calibre 1.20)" on Debian Linux (wheezy). I know it's not the latest, but it should be recent enough, isn't it? TiA |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,685
Karma: 28549304
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you want machine parseable output use calibredb catalog not calibredb list. The latter is meant for useage by humans.
calibredb catalog t.csv -h That error happens not when one of the requested fields is empty, but when it si empty for *all* the requested books. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Mar 2008
Device: HTC-p3000
|
reverse catalog
Nice, Thanks.
I have been using "calibredb catalog /tmp/catalog.xml --with-library=/..." which, if i'm right, dumps all non-null fields. Is there some way to use the same format to input data? It would be very handy to dump the catalog, modify/add to it and then reload it. IMHO "calibredb set-metadata" format isn't as strightforward. |
|
|
|
|
|
#4 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,685
Karma: 28549304
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No, the only way is to scriipt it via set_metadata.
|
|
|
|
![]() |
| Tags |
| calibredb, exception, traceback |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calibredb remove ... | BerlinerKindl | Library Management | 9 | 09-22-2025 06:07 AM |
| subseries_index does not appear in calibredb | reup | Library Management | 4 | 12-16-2011 06:46 AM |
| calibredb bugged? | Mar2zz | Library Management | 10 | 11-23-2011 10:28 AM |
| calibredb list | iomari | Calibre | 9 | 10-12-2011 12:30 PM |
| calibredb | iomari | Calibre | 6 | 10-10-2011 09:35 AM |