i am trying to cause Caliber show multiple book options to the user (in case i cannot pinpoint the exact book)
i do that by adding several Metadata objects into the result_queue
i also check the size of the queue before the end of the identify() function and it has multiple entries (i also print the results to the log)
but the UI always show only one result,
why is that ?
can it be done (show more then 1 results) ?
here is a sample of my code flow:
PHP Code:
def identify(self, log: Log, result_queue: Queue, abort: Event, title: str = None, authors: Iterable[str] = None, identifiers: Mapping[str, str] = None, timeout: int = 10) -> None:
log.info("================= identify() =================")
...
log.info(f"********** in Q before {result_queue.qsize()}")
self.retrieve_book_details(log, book_id, i, result_queue, abort, timeout)
log.info(f"********** in Q after {result_queue.qsize()}")
def retrieve_book_details(self, log: Log, plugin_id: str, relevance: int, result_queue: Queue, abort: Event, timeout: int) -> None:
log.info(f"Q size {result_queue.qsize()}")
log.info("================= retrieve_book_details() =================")
mi = Metadata(title, authors)
...
log.info(f"adding to Q[{result_queue.qsize()}]: {mi}")
result_queue.put(mi)
log.info(f"added to Q[{result_queue.qsize()}]")
this is an example of the log i get after process of metadata retrieve is finished:
Code:
The log from individual plugins is below
...
****************************** e-plugin (100, 4, 21) ******************************
Found 15 results
Downloading from e-plugin took 7.139270305633545
...
********** in Q before: 0
Q size: 0
================= retrieve_book_details() =================
adding to Q[0]: ...
added to Q[1]
********** in Q after: 1
...
********** in Q before: 14
Q size: 14
================= retrieve_book_details() =================
adding to Q[14]: ...
added to Q[15]
********** in Q after: 15
********************************************************************************
The identify phase took 7.19 seconds
The longest time (7.139270) was taken by: e-plugin
Merging results from different sources
We have 1 merged results, merging took: 0.00 seconds