Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-12-2011, 03:29 PM   #1
Sabkor
Junior Member
Sabkor began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Mar 2011
Device: PocketBook Pro 902
calibredb set_custom GUI question

I've created a custom column (I call genre) to help me have a more organized directory on my ebook reader. When I download news items, I couldn't find a way to populate this custom column without re-writing the recipe, so I decided to use a script that runs daily to run calibredb set_custom to set that custom column.

Anyways, after the script runs, the GUI is never updated. I don't see the custom column being set in the GUI of calibre. Is there any way to tell calibre that the database has been updated and to reread it? The only way I've found so far was to exit calibre and reopen it.
Sabkor is offline   Reply With Quote
Old 03-12-2011, 03:51 PM   #2
Sabkor
Junior Member
Sabkor began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Mar 2011
Device: PocketBook Pro 902
heh, and just found another problem of the same type.

Imported a bunch of new PDFs using the 'calibredb add' command and calibre was "notified of the change" by the command. The new PDFs showed up, but on the left, under authors, the authors did not show up. Had to exit and reopen calibre to get this to show up.

This does tell me that some commands do update the GUI automatically (at least partially), so is it just a bug that the add_custom command doesn't update the GUI? Or is there a command-line method to force a full GUI update?
Sabkor is offline   Reply With Quote
Advert
Old 03-12-2011, 06:24 PM   #3
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,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Do not add columns with calibredb while the GUI is running. Bad Things Will Happen
kovidgoyal is offline   Reply With Quote
Old 03-12-2011, 08:00 PM   #4
Sabkor
Junior Member
Sabkor began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Mar 2011
Device: PocketBook Pro 902
I'm not adding a column, I'm just adding data to a custom column. (I created the custom column in the GUI.)

Edit:

Maybe an example of what I'm doing would help. I have a batch file that does this:

calibredb list -f uuid -s search:"News" > genrenews.txt
for /F "tokens=1 skip=1 %%B in (genrenews.txt) DO calibredb set_custom genre %%B News

The first line does a saved search for all ebooks that have News as a tag, but not News as my custom column Genre and dumps that to a file. The second line updates my custom column, Genre, to be 'News' for each of those ebooks. However, if the GUI is running when I do this, calibre is never notified of the DB update. So the Genre column never updates to show the new information. If I open the ebook information, it does not show 'News' in the Genre column.

If I close and reopen Calibre, then it re-reads the database and everything is fine.

I'm wondering if this is a bug, or if there's some (command-line) way I can notify the Calibre GUI that the data in the database has changed and that it should re-read it.

Last edited by Sabkor; 03-12-2011 at 08:10 PM.
Sabkor is offline   Reply With Quote
Old 03-12-2011, 08:51 PM   #5
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
As per Kovid's comment, just *don't* leave the gui running while you are making updates to the database with command line tools. If you look through the forums you will see numerous posts about how only one user can have a Calibre library opened at a time. This is no different. It's not a bug, it's just the way Calibre works, only one application can safely write to the Calibre database at a time.
kiwidude is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Excel SQL query get metadata out of calibredb? unboggling Calibre 24 01-20-2011 02:45 AM
calibredb exit codes? mcqueary Calibre 1 01-02-2011 11:56 AM
calibredb update bug with 0.7.21? _Em Calibre 1 10-02-2010 04:20 PM
Problems Using Calibredb Commands in a Batch File Cartaphilus Calibre 3 01-22-2010 07:18 PM
Command line calibredb set_metadata problem Nedan Calibre 1 02-27-2009 08:44 PM


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


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