01-07-2021, 03:15 PM | #1 |
Connoisseur
Posts: 59
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet
|
More than one result per metadata source
Hello,
a title search in a metadata source found two results. Both are in result queue, as the log says. The results are two different books with the same title, but distinct authors and identifiers. In the metadata source configuration, the check box "more than one entry per source" is checked. Both entrys have priority 0. But in the gui only the 2nd book found is visible. Any hints? Thanks! |
01-07-2021, 09:48 PM | #2 |
creator of calibre
Posts: 44,428
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
metadata results are coalesced before being presented to the user if calibre determines they are the same. Although if as you say they have all different identifiers, they should not be getting coalesced. Look at the log,
|
Advert | |
|
01-11-2021, 07:09 AM | #3 |
Connoisseur
Posts: 59
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet
|
Perhaps found the cause
Hello Kovid,
looking into the log is good, looking into the source is even better ;-) In calibre\src\calibre\ebooks\metadata\sources\identi fy.py the results may be mixed or not according to different criteria. Since the search with identifier is preferred, I soon suspected the ISBN as bad guy. Hit! My source only has ISBNs in a few cases, namely for paperbacks. Most books are booklets with no ISBN, so i have created a identifier. In this case there were two sources: a paperback with ISBN and a booklet without ISBN. As I said, both have the same title, but different authors, identifiers, series, publication dates etc. With ISBN identifier in one of the two sources the log says: Found 2 results (...) Merging results from different sources We have 1 merged results, merging took: 0.00 seconds When i comment out the setting of the ISBN identifier in my plugin, the log says: Found 2 results (...) Merging results from different sources We have 2 merged results, merging took: 0.00 seconds And in the GUI both are listed. Can you check that please. |
01-11-2021, 09:47 AM | #4 |
creator of calibre
Posts: 44,428
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I dont see how thats possible. Merging on title is by (title, authors) so if the authors are different it wont merge. And merging on identifiers happens when there is at least one common identifier. So one of those two criteria must be true.
|
01-12-2021, 07:31 AM | #5 |
Connoisseur
Posts: 59
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet
|
Side effect on isbn?
Hello Kovid,
thanks for the answer. This is was i've seen in identify.py. But, again, i've two results (comments are omitted): Found 2 results --- Title : Schergen der SOL Author(s) : Rüdiger Schäfer Publisher : Pabel-Moewig Verlag KG Tags : None, None, SOL, Mausefalle-System Series : Atlan - Das absolute Abenteuer #2 Languages : deu Published : 2013-02-15T01:00:00+00:00 Identifiers : ppid:ATH2, isbn:9783845347547 --- Title : Schergen der SOL Author(s) : Peter Terrid Publisher : Pabel-Moewig Verlag KG Tags : Die Abenteuer der SOL, Die Solaner, SOL, Atlan, Wort Danyl, Chart Deccon, Kav Wergen, Tordya, Voorn Mekher Series : Atlan-Heftserie #503 Languages : deu Published : 1981-01-01T01:00:00+00:00 Identifiers : ppid:A503 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! |
Advert | |
|
09-24-2024, 10:54 AM | #6 | |
Connoisseur
Posts: 59
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet
|
Quote:
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() Code:
msprefs['keep_dups'] |
|
09-24-2024, 12:57 PM | #7 |
creator of calibre
Posts: 44,428
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
As I said, merging happens when one identifier is common. So if you set the isbn to a comman value then the results will be merged. If the isbn is not set to a common value they wont beunless title and author match.
|
09-26-2024, 06:09 AM | #8 |
Guru
Posts: 772
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
|
@feuille:
I understand your problem, but it is not directly related to identify.py. It's just that, by default, the result that contains the ISBN identifier is preferred – look in the base.py file: Code:
#: If set to True, and this source returns multiple results for a query, #: some of which have ISBNs and some of which do not, the results without #: ISBNs will be ignored prefer_results_with_isbn = True Code:
has_html_comments = True can_get_multiple_covers = True cached_cover_url_is_reliable = True Code:
prefer_results_with_isbn = False Code:
mi.set_identifier(‘isbn’, isbn) |
09-26-2024, 08:54 AM | #9 | |
Connoisseur
Posts: 59
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet
|
Quote:
I set it up like this yesterday and tested it after studying the code in base.py again. It works! But I wanted to make sure before giving feedback. Thanks for the confirmation! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Add new metadata source | richardofyork | Library Management | 1 | 10-25-2017 01:58 PM |
Download Metadata - Showing Only 1 Result | chris_crawford | Calibre | 10 | 04-12-2015 11:38 PM |
Download metadata merge result ? | abuck | Library Management | 1 | 10-11-2013 08:49 AM |
Metadata source? | rp272 | Library Management | 1 | 08-02-2011 09:33 AM |
Is there any way to add a metadata source? | slayda | Calibre | 3 | 06-09-2011 07:06 AM |