jurialmunkey / plugin.video.themoviedb.helper

GNU General Public License v3.0
200 stars 94 forks source link

[BUG] Can't get detailed info from a search #1047

Closed roidy closed 1 year ago

roidy commented 1 year ago

I'm filling a list with a search:-

plugin://plugin.video.themoviedb.helper?info=search&type=person&with_id=True&query=ron,&nextpage=false&fanarttv=false

If I open DialogVideoInfo for items from the search all the information is missing.

However if I then perform a different search, then do my original search again the info is then available.

jurialmunkey commented 1 year ago

TMDb provided lists such as search only provide basic information about the item. Retrieving additional details requires an additional lookup per item. For performance reasons, only previously cached detailed items are used in place of basic items.

Retrieving detailed items for all items regardless of cache status requires the user setting to be enabled Get additional details and artwork from TMDb. For lists that don't provide their own metadata (e.g. Trakt), this setting is forced.

The service monitor exists largely for this purpose of doing detailed item lookups on the fly. If the service monitor is not suitable (or needed for other details), then use the detailed item in a hidden list. https://github.com/jurialmunkey/plugin.video.themoviedb.helper/wiki/Detailed-Item

roidy commented 1 year ago

Thanks, but that doesn't explain why a second lookup with the same query provides the details but the first one doesn't.

A quick video to highlight the issue:- https://streamable.com/nu4esu

jurialmunkey commented 1 year ago

Because the service monitor has cached the item when you opened the info for it

roidy commented 1 year ago

Because the service monitor has cached the item when you opened the info for it

Which time, the first time or the second time?

That's what I don't understand. Perform the search first time and no info, perform the search a second time and the info is there. So the service monitor only retrieves and caches the info on the second lookup? That can't be right.

jurialmunkey commented 1 year ago

The first time the listing loads there are no detailed items cached. The listing loads using the metadata that the search endpoint in the TMDb API returns.

If you look at the metadata from the search endpoint for people, you can see that it returns very limited metadata (basically image, name, popularity, and known for: https://developers.themoviedb.org/3/search/search-people

When you then focus the item and press info, the service monitor loads the detailed item for that individual person. The detailed item is added to the Window(Home).Property(TMDbHelper.ListItem.PROPERTY) assuming you use the window property method (or if you use the container method it is added directly to the hidden container).

Kodi does not allow listitems to be modified after creation, so it is impossible for the service monitor to add details after the list is created. That is why it adds them to window properties (or a hidden container) instead.

When the detailed item is loaded by the service monitor, it is also cached to the itemdetails cache for quick future retrieval.

The next time you perform the search, TMDbHelper sees that it has a detailed item cached for that person, so it joins it to the listitem before it generates the directory listing of search results. That's why you get the details the second time.

roidy commented 1 year ago

If you look at the metadata from the search endpoint for people, you can see that it returns very limited metadata (basically image, name, popularity, and known for:

I've never really looked at the person endpoint of the API before but why on earth would they give you really detailed known_for information and then not give you something as simple as the persons bio, that's ridicules.

Thanks anyway, I appreciate all the help.