![]() |
#1 |
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Get Books showing if result is in library
I want to add the ability for results in Get Books to be marked if they are already in the users library. The idea being if a user searches for an author they can at a glance see what books they already have by the author.
My first thought is to use the comparison features of the Find Duplicates plugin. However, I'm concerned about performance and I'm also unsure about the best way to do this. The big thing that makes me think I need to use Find Duplicates is the fuzzy matching. My initial thought is to do a soundex search over each book in the users library using author and title each time Get Books is opened. Then store a hash of the title and authors. Then compute the hash for each result as they come in and check if there is an existing hash from the library. What I'm looking for is advice on the best way to go about this? |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,201
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
How fuzzy do you want to get? There is a find_identical_books() method in db2 that does a little bit of fuzzy matching.
But yeah the performance of this on larger libraries (where it is more useful) will be bad enough that you will likely need to run it in a separate thread like the drm status. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Fuzzy enough that these match:
Code:
Toll the Hounds (Malazan Book of the Fallen Series #8) by Steven Erikson Toll the hounds by Steven Erikson and The Hobbit by J RR Tolkien Hobbit by J. R. R. Tolkien I can easily run in a thread and have the result appear dynamically like covers and additional info does. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,201
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Sounds like you'll need to use find duplicates in that case. Since find duplicates is supposed to be merged into the calibre code base anyway, I'd suggest you go ahead and do that (if it is ok with kiwidude).
|
![]() |
![]() |
![]() |
#5 |
Calibre Plugins Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,722
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
I had replied to user_none with a PM while I was on holiday - if he or someone else is willing to do the work to merge the Find Duplicates plugin then please go for it. It isn't a high priority to do so for me given it is stable as is. As my available Calibre dev time is going to continue to be significantly reduced for at least the next little while I would rather spend the little I have doing any fixes for my other plugins...
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
It looks like merging kiwidude's code is your best option to have those match. As you do so, think about whether kiwidude's code could/should be combined with find_identical_books. Perhaps the user should get an option to control how aggressive the automated duplicate finding should be for AutoMerge, Copy To Library and Get Books? |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
books not showing in library | woodmansnow | Calibre | 2 | 05-14-2011 06:54 PM |
Sideloaded books not showing up in Library (again) | jhempel24 | Nook Color & Nook Tablet | 0 | 05-11-2011 01:52 AM |
Sideloaded books not showing up in Library | jhempel24 | Nook Color & Nook Tablet | 4 | 04-25-2011 11:42 AM |
Help! Sideloaded books now not showing up in Library after upgrade to 1.0.1 | leday | Nook Color & Nook Tablet | 16 | 01-19-2011 08:42 PM |
Calibre not showing library changes | costas | Calibre | 3 | 11-18-2010 02:58 AM |