jurialmunkey / plugin.video.themoviedb.helper

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

[Feature] Use Fanart with language from themoviedb as Landscape art #604

Closed roidy closed 2 years ago

roidy commented 2 years ago

As the title says, would it be possible to use Fanart from themoviedb that has a language and thus the text title as Landscape art.

I know the plugin can pull extra art including landscape from fanart.tv, however there are a lot of shows which don't have landscape art on fanart.tv but do have fanart on themoviedb that contains the title that Kodi could use.

Thanks Rob

jurialmunkey commented 2 years ago

This is a great idea. Also recently they added clearlogos to the TMDb API, so it'd be good to include those too.

It would need to be optional setting. The basic TMDb API calls only give the "best" poster and backdrop for each item - to get all images requires a separate API call per item, so it will slow things down as it introduces an additional 20 calls per widget - so it'd be basically double again with FanartTV enabled.

I'll also need to think about the best approach to introducing it, since it gets a bit more complex in terms of automatically determining which artwork to use. Currently the preference order is a simple overwrite: TMDb < FanartTV (if enabled) < Kodi DB (if enabled).

Best FanartTV artwork is determined by language preference and rating. Introducing TMDb art into the mix will need a way to compare the two (i.e. Does FanartTV still always beat TMDb if both are enabled? Or just mix both together and compare the ratings regardless of them being from two different sites and so not really comparable?).

roidy commented 2 years ago

I haven't worked with TMDb api in a while but you should be able to grab all images in the same api call as the show information using

append_to_response=images

For example this api call grabs basic info for the show 12 Monkeys and appends all the art to the end

https://api.themoviedb.org/3/tv/60948?append_to_response=images&api_key=xxxxxx

You can even filter by image language

https://api.themoviedb.org/3/tv/60948?append_to_response=images&include_image_language=en&api_key=xxxxxxx


Forget that, I just realised you can't use append_to_response on things like discover and trending lists, only on single items.

jurialmunkey commented 2 years ago

Forget that, I just realised you can't use append_to_response on things like discover and trending lists, only on single items.

Yeah that's the main problem. I already use append_to_response on details lookup, but the details lookup needs to be done individually on a per item basis rather than in one requests for the entire page of the list.

I do use threading for these individual look-ups, which helps quite a bit - but still, with the way Kodi requires all items for the container at once, then if any of the requests are slow the whole page of items is slow.

Also, even though appending is definitely quicker than making separate requests, the server still needs to do each database lookup and send the same amount of data - so each appended request will make things slower, especially if the server database is bottlenecked.

Still, I definitely think it's a worthwhile option. I'd tie it to a "Get full details from TMDb" type setting with a disclaimer like the fanarttv one that it will affect performance. I think it'd act as a good mid-point performance-wise between only-cached details vs full fanarttv+tmdb lookup.

jurialmunkey commented 2 years ago

@roidy - Can you test latest (v4.4.39)? Adds an extra option: TMDbHelper Settings > General > Get additional details and artwork from TMDb

I've added in the images endpoint to append_to_responses and some code to grab landscape+clearlogo from that. Looks to be working well for me.

Currently the TMDb < FanartTV < Kodi preference order is still in place, so if there's artwork from FanartTV it will overwrite the TMDb ones. And you can't select TMDb artwork yet in the manage artwork dialog - it's currently just auto picked based on rating and only FanartTV shows in manage - but I will add this once I think a bit more about the best approach.

FYI: You don't need to enable the setting for use with the service monitor - that should work automatically since it always does details lookup. The setting just enables detailed lookups for listitems in TMDb plugin paths (like what already happens for Trakt plugin paths or when FanartTV is enabled for plugin paths).

roidy commented 2 years ago

Oh wow that was fast :D

After some initial testing it seems to work great, however I'm not sure if the Get additional details and artwork from TMDb setting is working properly. When I installed the new version I had landscape art available from TMDb in my widgets even before enabling the option.

Big thanks for adding this 👍

jurialmunkey commented 2 years ago

After some initial testing it seems to work great, however I'm not sure if the Get additional details and artwork from TMDb setting is working properly. When I installed the new version I had landscape art available from TMDb in my widgets even before enabling the option.

Do you have FanartTV enabled and/or are these Trakt lists? Because details lookup is forced in those scenarios (FanartTV needs other IDs and Trakt has no art or details).

Also, note that if you already got details for the item via the service monitor, then next time the listitem loads the cached details will be used.

All the setting does is force the lookup for all lists if there's no previously cached details. Disabling the setting won't prevent details lookups where they would otherwise happen anyway.

roidy commented 2 years ago

Do you have FanartTV enabled and/or are these Trakt lists? Because details lookup is forced in those scenarios (FanartTV needs other IDs and Trakt has no art or details).

Yep, it was a trakt list, I didn't realise the lookup was forced in that case.

One problem I have just ran into is that some of the clear logos on TMDb are in svg format that Kodi doesn't support. For example the upcoming show The Afterparty (2022) has 3 clear logos but the first one is svg and that is the one being chosen.

jurialmunkey commented 2 years ago

One problem I have just ran into is that some of the clear logos on TMDb are in svg format that Kodi doesn't support. For example the upcoming show The Afterparty (2022) has 3 clear logos but the first one is svg and that is the one being chosen.

Ah, didn't even realise that they had SVG logos on TMDb - I think all of the ones I tested ended up being PNG. I can only dream of Kodi supporting SVG - would make for way nicer display in skins!

Anyway, latest update should fix it (well it will skip SVGs for logos now).

roidy commented 2 years ago

New version works perfect, thank 👍