Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 06-27-2012, 04:40 AM   #1
OffColour
Junior Member
OffColour began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2012
Device: Kindle
Newbie: set_metadata?

Hi folks,

Getting my head around the code structure, but a bit lost on exactly how/where metadata is getting updated following a change to, say, author in the main list view.

I added a print into the the obvious location of set_metadata, but not getting anything in the debug window. Debug seems to be working fine as I have the "*" and modifying existing print statements works.

Thanks

Gary
OffColour is offline   Reply With Quote
Old 06-27-2012, 05:43 AM   #2
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
What "metadata" are you talking about? The metadata store inside a book format? Because as has been well documented that data is only ever updated by calibre (for books inside the library) during a conversion process, or when you export using send to device/save to disk (or using the Modify ePub plugin). Changing a title/author etc does not change the data inside a book.
kiwidude is offline   Reply With Quote
Old 06-27-2012, 08:46 AM   #3
OffColour
Junior Member
OffColour began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2012
Device: Kindle
Hi,

I'm talking about the entry in metadata.db and the changing of the folder for a book in the library when the author is changed.
OffColour is offline   Reply With Quote
Old 06-27-2012, 09:54 AM   #4
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
Right, the actual database.

I would suggest the starting point if you are looking at a library screen edit activity is in calibre/gui2/library/models.py. Specifically the _set_data() function which I believe all the delegates end up channeling through. You can see some special cases in there for some column types, but authors fall into the general case of calling self.db.set() which I believe will go to the set() function in calibre/library/database2.py

In the case of authors then you will end up in that same database2.py file in set_authors() which calls set_path() after updating the library.

Thats my guesses from a quick look at the code without putting any print statements of my own in to verify . I'm sure Kovid/chaley can correct me if I'm wrong which is equally possible.
kiwidude is offline   Reply With Quote
Old 06-27-2012, 10:52 AM   #5
OffColour
Junior Member
OffColour began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2012
Device: Kindle
Excellent. Thanks for the help.
OffColour is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
set_metadata and covers DarkAbsynthe Calibre 12 09-19-2020 02:38 PM
Can;t modify user columns with set_metadata? Silek Development 4 07-09-2011 02:40 PM
Newbie Here jkz4000 Introduce Yourself 4 05-16-2011 10:56 AM
newbie jvgp Introduce Yourself 9 08-15-2009 10:37 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 05:09 AM.


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