View Single Post
Old 05-16-2024, 04:03 AM   #1
dandman
Enthusiast
dandman is clearly one to watchdandman is clearly one to watchdandman is clearly one to watchdandman is clearly one to watchdandman is clearly one to watchdandman is clearly one to watchdandman is clearly one to watchdandman is clearly one to watchdandman is clearly one to watchdandman is clearly one to watchdandman is clearly one to watch
 
Posts: 29
Karma: 10545
Join Date: May 2024
Device: none
Metadata plugun multiple results

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(selflogLogresult_queueQueueabortEventtitlestr NoneauthorsIterable[str] = NoneidentifiersMapping[strstr] = Nonetimeoutint 10) -> None:
        
log.info("=================  identify()  =================")

        ...

        
log.info(f"********** in Q before {result_queue.qsize()}")
        
self.retrieve_book_details(logbook_idiresult_queueaborttimeout)
        
log.info(f"********** in Q after {result_queue.qsize()}")



    
def retrieve_book_details(selflogLogplugin_idstrrelevanceintresult_queueQueueabortEventtimeoutint) -> None:
        
log.info(f"Q size {result_queue.qsize()}")
        
log.info("=================  retrieve_book_details()  =================")
        
mi Metadata(titleauthors)

        ...

        
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
dandman is offline   Reply With Quote