xbmc / metadata.themoviedb.org.python

Other
44 stars 40 forks source link

Fanart language seems to be ignored #123

Closed mkaflowski closed 2 years ago

mkaflowski commented 2 years ago

I have set "pl" langague but I enabled fanart and set "en". For movies like "Meet the Fockers" I get "pl" poster. Why? Does it should be?: "en" (fanart) -> "pl" (tmdb) and for "pl" set in fanart: "pl" (fanart) -> "en" (fanart as fallback in the new version) -> "pl" (tmdb)

KarellenX commented 2 years ago

So you want Polish language metadata, but you want all artwork to be English. Is that correct?

Could you explain where you changed the setting and how you accessed that screen. Exact details. thanks.

mkaflowski commented 2 years ago

I want to prioritize fanart. Polish posteres from tmdb are bad quality very often. In the previous version when I set "en" in fanart settings an english fanart was set. I have set preffered language "pl" to get titles and descriptions but in fanart section I have set "en" and it doesn't work so this option seems to be pointless now.

KarellenX commented 2 years ago

Ok, but you still haven't answered my second question.

mkaflowski commented 2 years ago

What do you mean by accessing screen? image image

KarellenX commented 2 years ago

Thanks, but how did you get to that screen?

Did you go Settings>Addons>My Addons> Information Provider>Movies

or did you go to Videos>Files>Your Source>Change Content?

Which one?

mkaflowski commented 2 years ago

Videos>Files>Your Source>Change Content

mkaflowski commented 2 years ago

Ok, I see that posters are sorted by language in combine_scraped_details_available_artwork. I will try to add an option to have ability to prioritize fanart.

KarellenX commented 2 years ago

Videos>Files>Your Source>Change Content

Great. And bad. Bad because I was hoping you used the other method, which would explain the problem.

Great because you obviously know the difference between the two. The other one sets a default, and has no effect on existing Sources.

Ok, I see that posters are sorted by language in combine_scraped_details_available_artwork. I will try to add an option to have ability to prioritize fanart.

As soon as I get home I will test it to check if I have the same results. I am sure I will.

mkaflowski commented 2 years ago

Ok something like this should be good:

def combine_scraped_details_available_artwork(original_details, additional_details, language, settings):
    if language:
        # Image languages don't have regional variants
        language = language.split('-')[0]
    if additional_details and additional_details.get('available_art'):
        available_art = additional_details['available_art']
        if not original_details.get('available_art'):
            original_details['available_art'] = {}
        for arttype, artlist in available_art.items():
            artlist = sorted(artlist, key=lambda x:x['lang']==language, reverse=True)
            combinlist = artlist + original_details['available_art'].get(arttype, [])
            original_details['available_art'][arttype] = combinlist

            if not settings.getSettingBool('prioritize_fanarttv_artwork'):
                original_details['available_art'][arttype] = sorted(combinlist, key=lambda x:x['lang']==language, reverse=True)

When I change python files do I have to restart Kodi every time to see results (I use macos)? I will make some pull request tommorow.