View Single Post
Old 10-08-2011, 09:25 PM   #68
Kolenka
<Insert Wit Here>
Kolenka ought to be getting tired of karma fortunes by now.Kolenka ought to be getting tired of karma fortunes by now.Kolenka ought to be getting tired of karma fortunes by now.Kolenka ought to be getting tired of karma fortunes by now.Kolenka ought to be getting tired of karma fortunes by now.Kolenka ought to be getting tired of karma fortunes by now.Kolenka ought to be getting tired of karma fortunes by now.Kolenka ought to be getting tired of karma fortunes by now.Kolenka ought to be getting tired of karma fortunes by now.Kolenka ought to be getting tired of karma fortunes by now.Kolenka ought to be getting tired of karma fortunes by now.
 
Kolenka's Avatar
 
Posts: 1,017
Karma: 1275899
Join Date: Jan 2008
Location: Puget Sound
Device: Kindle Oasis, Kobo Forma
Quote:
Originally Posted by kovidgoyal View Post
The USBMS classes maintain a cache of metadata read from the ebook files in the file metadata.calibre in the root of the device. You should allow USBMS to read metadata from the files as normal (this will automatically use the cache wherever possible). Then take the resulting books and match them against entries in the SONY db. This gives you excellent performance (after the initial scan) and it allows you to present correct and complete metadata to the user in the device view without having to rely on the vagaries of SONY's metadata reading implementation.

See for example the books() and sync_booklists() methods in the old sony driver.
Hmm, indeed. I used the Kobo as more of a template, than the 505 driver.

I was suspicious that this wouldn't work as expected due to sync_bookslists being called where it was. It was a bit hard to track the order of things and the end result. So I tested it by downloading and adding a book to a collection. Amazingly, that collection showed up in Calibre as I expected. Had to make a couple other small tweaks in the process, but it has killed the bug (along with another from rewriting sync_booklists from earlier), and perf is good enough.

I've included an updated patch with the feedback. It's at the point now that it's pretty usable. Really just needs thumbnail support (not 'vital', IMO) and maybe some fine tuning (more user options, perhaps) to catch up to the existing 505 driver.
Kolenka is offline   Reply With Quote