Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 01-30-2018, 09:30 AM   #1
jindroush
Connoisseur
jindroush is on a distinguished road
 
Posts: 78
Karma: 52
Join Date: Nov 2014
Device: Kindle
calibredb add questions

Hi,
I have two problems:

a) calibredb.exe add --library-path=F:\TXT\books\Calibre_Cze "Dean Koontz - Collection.Poetry.The.Book.Of.Counted.Sorrows - 2003.epub"

never finishes (never = few minutes) and does something to the .db. After killing the process, the ebook is in db, also copied into the tree.
I tried to find similar problems here, never found any. The ebook should not be the problem, tried the different ones. From gui it works okay.


b) Could it be possible to add something like '--fields' switch for immediate changing custom db fields on file add?

Running latest calibre 3.16, on win7 64bit eng and being happy with it ;-)

Thx,
J.
jindroush is offline   Reply With Quote
Old 01-30-2018, 09:47 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you look at manual for calibredb you will see that you can specify several metadata fields using options sunch as --title, --author --identifier etc.

As for it getting stuck, I have no idea why that is, it certainly is not normal.
kovidgoyal is offline   Reply With Quote
Old 01-30-2018, 10:02 AM   #3
jindroush
Connoisseur
jindroush is on a distinguished road
 
Posts: 78
Karma: 52
Join Date: Nov 2014
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post
If you look at manual for calibredb you will see that you can specify several metadata fields using options sunch as --title, --author --identifier etc.

As for it getting stuck, I have no idea why that is, it certainly is not normal.
I know I can update "standard" db fields with the cmdline switches, but I need to update only one custom field.

Regarding the "unending add" operation - is there any way how to pass debug option to calibredb or having db operations logged or something like that? I can see that .db is constantly updated, also some transaction file appears there.
jindroush is offline   Reply With Quote
Old 01-30-2018, 10:10 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There's now ay a single add can cause the db to be continuously updated. Are you running some other calibre program accessing the db at the same time?

And no you cannot update custom field during an add, you should use calibredb set_metadata for that with the id printed by calibredb add (of course in your case since calibredb add is hanging you cannot do that).
kovidgoyal is offline   Reply With Quote
Old 01-30-2018, 10:31 AM   #5
jindroush
Connoisseur
jindroush is on a distinguished road
 
Posts: 78
Karma: 52
Join Date: Nov 2014
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post
There's now ay a single add can cause the db to be continuously updated. Are you running some other calibre program accessing the db at the same time?

And no you cannot update custom field during an add, you should use calibredb set_metadata for that with the id printed by calibredb add (of course in your case since calibredb add is hanging you cannot do that).
I know there are no cmdline switches for now, I'm just asking if you maybe want to add such a switch so that I don't have to do that in two steps.

Ok, so for now, I ran the command on 16:11.
I can see calibre creating:
Koontz Dean subdir on 16:11
2003 (62602) on 16:11
2003 - Koontz Dean.epub on 16:11
from that time I can hear harddrive sounds and I can see metadata.db and metadata.db-journal being constantly updated.

No other calibre process is running, just calibredb.exe. Checked that in the task manager, there are also seen tens of thousands of read/writes. Right now, 7 minutes in running, I see 85MB of read data, 42MB of written data.

The db has 24MB, ebook 100kB.

After 10 minutes of running, I killed it. Also I have to note that this is 4-core XEON machine with nothing to do and 16GB of memory, so we're not running under stressed condition here, or swapping.


HA! I ran procmon and it seems that it does something to .opf files in my library, tons of operations around them. Checked one of the changed .opfs, it seems that it somehow 'backups' the newly created custom metadata fields to them. So it means it's not unending, but extremely slow, also doing something 'automagically' without my consent. #metoo

Last edited by jindroush; 01-30-2018 at 10:41 AM.
jindroush is offline   Reply With Quote
Old 01-30-2018, 12:10 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Run

calibredb backup_metadata

let it finish and after that adding should be fast.

And I have no interest in adding another option to add myself, but I wont refuse a patch.
kovidgoyal is offline   Reply With Quote
Old 01-30-2018, 02:08 PM   #7
jindroush
Connoisseur
jindroush is on a distinguished road
 
Posts: 78
Karma: 52
Join Date: Nov 2014
Device: Kindle
Yep, the metadata backup was the culprit behind this.
Maybe there could be a message or the different behavior, because the gui does not behave in that way.

Thanks,
J.
jindroush is offline   Reply With Quote
Old 01-31-2018, 12:10 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The GUI does metadata backup in the background. There is no background for CLI tools. It isn't normally a problem, unless you have lots and lots of unbacked up book records.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Series to Title in CalibreDB? phossler Calibre 4 01-27-2015 09:19 AM
calibredb add - exclude formats? perler Library Management 5 11-26-2014 03:21 PM
calibredb add problem jmwatte Calibre 6 10-17-2014 02:30 AM
calibredb add metadata issue vir_db Library Management 0 07-21-2014 07:12 AM
calibredb add -- how to add additional metadata? TuxGirl Calibre 16 12-29-2011 01:01 AM


All times are GMT -4. The time now is 03:34 PM.


MobileRead.com is a privately owned, operated and funded community.