@Kolenka: I haven't had a chance to review your code, but on general principles...
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.
Last edited by kovidgoyal; 10-08-2011 at 03:08 PM.
|