Komet / MediaElch

Media Manager for Kodi
https://mediaelch.github.io/mediaelch-doc/about.html
GNU Lesser General Public License v3.0
845 stars 94 forks source link

Poster Language #904

Open ticao2 opened 4 years ago

ticao2 commented 4 years ago

Is your feature request related to a problem? Please describe. Poster Language In a film that is already in your collection. You decide to find another poster. Then you click on the poster to search. Nothing on Fanart.tv. Select TMDb. Only posters in English appear. There are no posters in my language. Up to version 2.6.0, posters appeared in my language and in English.

Describe the solution you'd like It would be better if posters appeared in my language, in the original language of the film and in English. I suppose that for posters to appear in the original language of the film it would be necessary to store this information in the NFO. Another solution would be to add a Dropdown in the search window to select the language.

bugwelle commented 4 years ago

Thank you for this feature request. I'll look into what has changed between v2.6.0 and v2.6.4 in regards to poster language. :-)

ticao2 commented 4 years ago

Now things got more complicated. TMDb is undergoing "Maintenance" and MANY images are being deleted. The reason is not very clear but it seems that it must be a copyright issue mixed with the date the image was added to the BD. So, there are cases of American film with only one poster in German or Japanese. This should make life difficult for those who do Multi Scraping. If you are looking for another poster, you will only find it in English or find nothing.

bugwelle commented 4 years ago

TMDb is undergoing "Maintenance" and MANY images are being deleted.

:-/

Thank you for letting me know.

ticao2 commented 4 years ago

I don't know if that helps, but ... I consulted the API documentation, https://developers.themoviedb.org/3/getting-started/image-languages and found the following information. When making a basic API Request, https://api.themoviedb.org/3/movie/10882?api_key=[THE_KEY]&language=pt-BR the poster_path informed, is always the most voted. And the following language preference rule follows: 1 The language of your basic search, or 2 The Original Language, that of the movie, or 3 The most voted among all, regardless of language Usually the most voted of all is in English. I believe that ME is not using this poster_path of basic research. I say this because, I researched some Italian and French films and, when they didn't have a poster in Portuguese, the poster always comes in English. The poster never comes in the original language. It might be better to use this poster_path of the basic answer.


EDIT
In time: to receive all the information that the ME needs, just add in the Basic Request 2 parameters append_to_response. https://api.themoviedb.org/3/movie/10882?api_key=[THE_KEY]&language=pt-BR&append_to_response=credits,release_dates

bugwelle commented 4 years ago

For images, MediaElch uses not only the API parameter language but also include_image_language=en,null,<your-language>. By using this images are loaded not only in the selected language but also in English. I added this because some movies didn't have posters in some languages. But I didn't read anywhere in what order the images are sent.

A path that MediaElch uses for images looks like:

https://api.themoviedb.org/3/movie/<movie-id>/images?api_key=<key>&language=pt-BR&include_image_language=en,null,pt

I haven't heard of poster_path, yet and will need to look into it.

ticao2 commented 4 years ago

I added this because some movies didn't have posters in some languages. But I didn't read anywhere in what order the images are sent.

I think the TMDb administrator, Travis Bell, had the same concern as you did. That's why you programmed the response in this way to the poster information, with language preference. And so he programmed the response in this way to the poster information, with language preference. As I remembered some comment in the past, from Travis Bell, I went to search the API instructions. I will reproduce the text here. As my language is not English, for me it is a little confused, long-winded.

poster_path:The poster_path will query the language you specify first and default back to the highest rated image of the items "original language" if it's present. If that image doesn't exist, it simply falls back to the highest rated. It's important to note that even though our language query parameter supports regional lookups, these regional variants are not supported for images at this time. This will be getting added at a later date. Source https://developers.themoviedb.org/3/getting-started/image-languages

So I think using this response from poster_path is a simpler solution.

ticao2 commented 4 years ago

But, and there is always a But, if the user doesn't like the image of the Poster, then they will click on the image to look for an alternative. And in this case the API Request that must be made is the one you posted, with only the addition of the Original Language. And this information, which is the original language, is in the Basic API Request in the original_language item. Perhaps that information should be stored in the NFO. This is because if the user wants to change the poster later, it is not necessary to make the basic API Request again, just to obtain this information.

ticao2 commented 4 years ago

For images, MediaElch uses not only the API parameter language but also include_image_language=en,null,<your-language>. By using this images are loaded not only in the selected language but also in English. I added this because some movies didn't have posters in some languages. But I didn't read anywhere in what order the images are sent.

A path that MediaElch uses for images looks like:

https://api.themoviedb.org/3/movie/<movie-id>/images?api_key=<key>&language=pt-BR&include_image_language=en,null,pt

As you are redoing Scraping, this information may be useful: If you make this API Request, you will only receive images in the specified languages.

https://api.themoviedb.org/3/movie/550/images?api_key=THE_KEY&language=pt-BR&include_image_language=en,null,pt  

But, if you make this API Request, without specifying language (&include_image_language=en,null,pt)
and also without specifying a Request language (&language=pt-BR), then you will receive ALL TMDb posters and fanart (backdrop).

https://api.themoviedb.org/3/movie/550/images?api_key=THE_KEY