05-10-2010, 02:14 AM | #46 | |
Groupie
Posts: 155
Karma: 112134
Join Date: May 2009
Location: Kuala Lumpur
Device: iPad, K3, K4, T1
|
Quote:
|
|
05-10-2010, 05:12 AM | #47 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
More features: book in library/on device columns
Using code originally written by user_none (thank you!), we have added columns to both the device and library displays that indicate whether a book is on the device or is in the library. When you plug in a device, the column appears and then is filled in appropriately. Unplug the device and the column goes away.
This feature is available in releases 0.6.92 and higher. Download links are in post #1. Some caveats: 1) the matching algorithm is approximate. Calibre makes its best guess about whether a given book is the same on the device and library. There are two matching schemes, one using title and author, and one using title and a short ID. The scheme using the short ID is much more accurate, but it requires that the file on the device end in _NNN where NNN is the library key. In the past, only Sony's included this information but now all USB-based devices do it. To get more accurate matching, you will probably need to copy the books to the device again. What worked best for me was to empty my device (I formatted it), then fill it again from Calibre. Title + author matching checks all authors, which means it won't match if the book has multiple authors but the device saves only one of them (which my Sony Pocket seems to do). It also won't match if the metadata for the format does not match the metadata in the library database. Neither will match if the title in the book metadata does not match the title in the library metadata. Bottom line: there is no guarantee that the OnDevice/InLibrary indications are 100% accurate. However, when using the short ID, testing has shown that they are very close. 2) The current beta has some problems with column geometry. When the ondevice column comes and goes, columns to the right change to the size of their neighbor. I am looking for ways to fix this. Work-around: move the column to the end. 3) Deleting books from either the library or the device does not (yet) update the other display. Adding books from the library to the device does the right thing. 4) We have tested it on devices we have: Sony PRS-300, Sony 505, and a Kindle. Other devices *should* work, but the binary goblins are still out there. As always, have fun. PS: There might be some comments in this post Last edited by chaley; 05-10-2010 at 05:19 AM. Reason: Add link to other post, just in case comments end up there |
Advert | |
|
05-10-2010, 11:01 AM | #48 |
Zealot
Posts: 126
Karma: 1826
Join Date: Jan 2010
Device: Kindle 2
|
Interesting... this will be very handy
Calibre contributers keep breaking our expectations and then some |
05-10-2010, 11:41 AM | #49 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
IIRC, that code requires an exact match of {authors}, but uses a fuzzy match of title (convert to lower case, remove punctuation, eliminate excess whitespace, remove leading indefinite articles "a", "an", "the", etc.). I don't know if you see any reason the matching algorithms should be coordinated, but in case you aren't aware of the other algorithm's existence, I thought I'd comment. I don't have any ebook devices (or none that Calibre considers to be a "Device"), so I'm not really up to speed on the benefits or disadvantages of one matching algorithm over another. Last edited by Starson17; 05-10-2010 at 11:51 AM. |
|
05-10-2010, 12:13 PM | #50 | ||
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I am using user_none's code, which first lower_cases the title and then uses a regexp to prepare the title for matching. The regexp, Code:
re.sub('(?u)\W|[_]', '' ...) Quote:
What I don't know is if it would be useful. Sometimes I want it, and sometimes I think that saving to disk is enough. However, with the new OnDevice feature, I think that I will want my phone to be considered a valid device. Reflection continues. |
||
Advert | |
|
05-10-2010, 12:18 PM | #51 | |
creator of calibre
Posts: 43,867
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
05-10-2010, 12:23 PM | #52 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
05-10-2010, 01:27 PM | #53 | |
creator of calibre
Posts: 43,867
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
1) Allow the user to pick a removable disk 2) Find the usb device it belongs to 3) Find any other disks that belong to that device 4) Allow the user to specify what formats and base dorectory to use when sending to the device I agree that it would be great to have this, I've just never been motivated enough to climb this hill. |
|
05-10-2010, 01:43 PM | #54 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
I've got some that aren't mountable (ActiveSync) and some that are USB disk mountable, but don't properly report all data that Calibre wants reported (the HTC HD2) and some that I haven't looked at closely, but might have sufficient info (ordinary USB card reader). I completely agree with Charles, which is that "Sometimes I want it, and sometimes I think that saving to disk is enough. "
|
05-10-2010, 02:04 PM | #55 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I could do all that for windows and perhaps for linux (would need to set up a VM), but not for Mac. So I will ignore it.
I have a driver for my phone, an HTC Touch Diamond2 running WM 6.5. It took me a little while to understand what to do because I didn't fully understand card matching until I traced it through the code. My phone won't show its main mem as a drive and it presents its card without any significant ID details. Although the driver works, the lack of extra ID details makes me nervous. The USB ID info is u'usb\\vid_0bb4&pid_0c30&rev_0000'] The storage ID is Code:
\\?\STORAGE#VOLUME#_??_USBSTOR#DISK&VEN_&PROD_&REV_#3FBF5000-7351-0801-3561-580209983530&0#{53F56307-B6BF-11D0-94F2-0A0C91EFB8B}#{53F5630D-B6BF-11D0-94F2-00A0C91EFB8B} I have no idea how this will present on a Mac or Linux, so my driver doesn't permit them. FYI - the driver code is: Code:
class HTC_TD2(USBMS): name = 'HTC TD2 Phone driver' gui_name = 'HTC TD2' description = _('Communicate with HTC TD2 phones.') author = 'Charles Haley' supported_platforms = ['windows'] # Ordered list of supported formats FORMATS = ['epub', 'pdf'] VENDOR_ID = { # HTC 0x0bb4 : { 0x0c30 : [0x000]}, } EBOOK_DIR_MAIN = ['EBooks'] EXTRA_CUSTOMIZATION_MESSAGE = _('Comma separated list of directories to ' 'send e-books to on the device. The first one that exists will ' 'be used') EXTRA_CUSTOMIZATION_DEFAULT = ', '.join(EBOOK_DIR_MAIN) VENDOR_NAME = [''] WINDOWS_MAIN_MEM = [''] # OSX_MAIN_MEM = 'HTC TD2 Phone Media' # MAIN_MEMORY_VOLUME_LABEL = 'HTC Phone Internal Memory' SUPPORTS_SUB_DIRS = True def post_open_callback(self): opts = self.settings() dirs = opts.extra_customization if not dirs: dirs = self.EBOOK_DIR_MAIN else: dirs = [x.strip() for x in dirs.split(',')] self.EBOOK_DIR_MAIN = dirs |
05-10-2010, 03:01 PM | #56 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Having my phone's storage card treated as a calibre device is very nice. I get easy copying and management of books and the OnDevice stuff works a treat. The only downside found so far is the time to 'mount' the device, while calibre scans metadata.
|
05-10-2010, 04:42 PM | #57 |
creator of calibre
Posts: 43,867
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Unfortunately, you need the storage id to have non null values for VEN and PROD, otherwise you cannot have more than one such driver in the calibre code base.
Unless you can figure out how to get the UUIds associated with the usb vendor and product ids. On linux and osx that driver will work automatically (they have much saner USB subsystems than windows). |
05-10-2010, 04:48 PM | #58 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
05-10-2010, 07:21 PM | #59 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Just curious, are you not using the metadata caching code that I was using with the on device column? It included id's associated with the library entry so the file names didn't have to be modified?
|
05-10-2010, 09:23 PM | #60 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Given the above, and because ondevice is such a useful thing to have, it seemed to make sense to slightly extend work you had already done to provide a more reliable indication. Adding the id to the name, which is what the Sonys already do, was the most straightforward and carried a minimal cost. Of course, it does not provide the performance enhancement that metadata caching gives, and it junks up the names a bit. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copia beta test - Get Your Invite Now! | Nate the great | Announcements | 34 | 11-18-2010 07:48 PM |
Beta Test of new Kobo Driver | timlegge | Calibre | 58 | 06-22-2010 07:37 AM |
Beta Beta Test of Major New Features | Starson17 | Calibre | 45 | 05-17-2010 10:55 AM |
DR800 V2 Beta Firmware Battery Test | CoolDragon | iRex | 29 | 05-11-2010 05:37 AM |
Mobile Forum Beta Test Here! | Alexander Turcic | Announcements | 12 | 03-10-2004 05:38 PM |