Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-12-2011, 04: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, 04: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
Old 03-12-2011, 07: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: 26,344
Karma: 5382313
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, 09: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 09:10 PM.
Sabkor is offline   Reply With Quote
Old 03-12-2011, 09:51 PM   #5
kiwidude
calibre/Sigil 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,230
Karma: 1345754
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
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
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:45 AM
calibredb exit codes? mcqueary Calibre 1 01-02-2011 12:56 PM
calibredb update bug with 0.7.21? _Em Calibre 1 10-02-2010 05:20 PM
Problems Using Calibredb Commands in a Batch File Cartaphilus Calibre 3 01-22-2010 08:18 PM
Command line calibredb set_metadata problem Nedan Calibre 1 02-27-2009 09:44 PM


All times are GMT -4. The time now is 10:42 AM.


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