Quote:
Originally Posted by feuille
Hello Kovid,
And when the line
mi.set_identifier('isbn', isbn)
is active, only the result with the isbn is displayed. When comment out, both results are displayed. No other change, I swear!
|
Hello Kovid,
it's been a while, but in another plugin (from another author) I've stumbled over the same issue: The log shows three books with search string in title, only one with ISBN. In the GUI, only the result with ISBN is displayed. This time, I'm searching the Calibre source in
https://github.com/kovidgoyal/calibr...es/identify.py and found a code sequence, who is possible the cause for this behavior:
Code:
# Now handle results that have no ISBNs
results = sorted(self.isbnless_results,
key=attrgetter('relevance_in_source'))
# Only use results that are from sources that have not also returned a
# result with an ISBN
results = [r for r in results if r.identify_plugin not in isbn_sources or not r.identify_plugin.prefer_results_with_isbn]
if results:
# Pick only the most relevant result from each source
seen = set()
for result in results:
if msprefs['keep_dups'] or result.identify_plugin not in seen:
seen.add(result.identify_plugin)
self.results.append(result)
result.average_source_relevance = \
result.relevance_in_source
self.merge_metadata_results()
Is there a way to set
Code:
msprefs['keep_dups']
or another option to avoid the merge process?