View Single Post
Old 07-12-2012, 06:42 PM   #1
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,320
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
db.find_identical_books() and large numbers of authors

In my FFDL plugin I've been successfully using LibraryDatabase2.find_identical_books(mi) to find existing, matching books for some time, like so:

Code:
            mi = MetaInformation(story.getMetadata("title"),
                                 story.getList("author"))
            identicalbooks = db.find_identical_books(mi)
This works until somewhere between 50 and 120 authors. 50 works, but when there's 120 authors the find fails due to recursion depth exceeded:

Spoiler:
Traceback (most recent call last):
File "site-packages\calibre\library\database2.py", line 1096, in find_identical_books
File "site-packages\calibre\utils\search_query_parser.py", line 207, in parse
File "site-packages\calibre\utils\search_query_parser.py", line 215, in _parse
File "site-packages\calibre\utils\pyparsing.py", line 1021, in parseString
File "site-packages\calibre\utils\pyparsing.py", line 894, in _parseNoCache
File "site-packages\calibre\utils\pyparsing.py", line 2623, in parseImpl
File "site-packages\calibre\utils\pyparsing.py", line 894, in _parseNoCache
File "site-packages\calibre\utils\pyparsing.py", line 2478, in parseImpl
File "site-packages\calibre\utils\pyparsing.py", line 894, in _parseNoCache
File "site-packages\calibre\utils\pyparsing.py", line 2623, in parseImpl
...
File "site-packages\calibre\utils\pyparsing.py", line 2478, in parseImpl
File "site-packages\calibre\utils\pyparsing.py", line 894, in _parseNoCache
File "site-packages\calibre\utils\pyparsing.py", line 2623, in parseImpl
File "site-packages\calibre\utils\pyparsing.py", line 894, in _parseNoCache
File "site-packages\calibre\utils\pyparsing.py", line 2351, in parseImpl
File "site-packages\calibre\utils\pyparsing.py", line 894, in _parseNoCache
File "site-packages\calibre\utils\pyparsing.py", line 2819, in parseImpl
File "site-packages\calibre\utils\pyparsing.py", line 894, in _parseNoCache
File "site-packages\calibre\utils\pyparsing.py", line 2478, in parseImpl
File "site-packages\calibre\utils\pyparsing.py", line 894, in _parseNoCache
File "site-packages\calibre\utils\pyparsing.py", line 2351, in parseImpl
File "site-packages\calibre\utils\pyparsing.py", line 898, in _parseNoCache
RuntimeError: maximum recursion depth exceeded


Is there a better way to find matching books?

I hesitate to call it a bug because 120 authors is kind of crazy. But calibre is okay with having books with that many authors, it's just the find_identical_books call that fails.
JimmXinu is offline   Reply With Quote