Kodi Community Forum
Background script with language - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300)
+---- Thread: Background script with language (/showthread.php?tid=366759)

Pages: 1 2 3


Background script with language - kpinheiro - 2022-01-28

Hey guys!

I need help filtering fanart with language.

I'm using the script below to bring background, but it's bringing no language.

How do I bring with language?

<content sortby="random" limit="5">plugin://plugin.video.themoviedb.helper/?info=upcoming&;type=movie</content>


RE: Background script with language - roidy - 2022-02-01

As I said fanart from TMDb with no language/text is written into fanart by the addon:-

Code:
ListItem.Art(fanart)

And any fanart from TMDb with a language/text is written into landscape by the addon:-

Code:
ListItem.Art(landscape)

So just create a variable to check if landscape art is available or not:-

Code:
<variable name="art">
  <value condition="!String.IsEmpty(Container(12341).ListItem.Art(landscape))>$INFO[Container(12341).ListItem.Art(landscape)]</value>
  <value>$INFO[Container(12341).ListItem.Art(fanart)]</value>
</variable>

Then use the variable in your list/widget.

<imagepath>$VAR[art]</imagepath>


RE: Background script with language - kpinheiro - 2022-02-02

Can help where I enter this command line. Please


RE: Background script with language - kpinheiro - 2022-02-02

When I add this line, it doesn't bring up any image, just black screen. How much shooting brings fanart. Looking at the tmdb helper plugin Wiki, there is nothing lanscape, I think the plugin does not have landscape support


RE: Background script with language - kpinheiro - 2022-02-02

After reading a lot lol, I did what you asked me to, but with the command line:

<value condition="!String.IsEmpty(Container(12341).ListItem.Art(landscape))>$INFO[Container(12341).ListItem.Art(landscape)]</value>

Nothing happens just black screen.

If I remove the first line leaving just like this:
<variable name="art">
  <value>$INFO[Container(12341).ListItem.Art(fanart)]</value>
</variable>


He brings back the fanarts, without language.

Can you still help me?
s the plugin compatible with landscape TMDB?

 If it helps I'm using the PELLUCID skin

I'm using this plugin for home screen background, to search for images of movies and TV Show in a random way, but that will have the name of the movie or TV SHow in the image.

Thank you very much for your attention.


RE: Background script with language - kpinheiro - 2022-02-03

I don't know if it helps.

But in a file plugin.video.themoviedb.helper

FILE: tmdb.py

There is this setting where it deals with image language.

But I don't have any knowledge to modify.


class TMDb(RequestAPI):
    def __init__(self, api_key=None, language=None, cache_long=None, cache_short=None, append_to_response=None, mpaa_prefix=None, filter_key=None, filter_value=None, exclude_key=None, exclude_value=None):
        super(TMDb, self).__init__(
            cache_short=cache_short, cache_long=cache_long,
            req_api_name='TMDb', req_api_url='https://api.themoviedb.org/3', req_wait_time=0,
            req_api_key='api_key=a07324c669cac4d96789197134ce272b')
        api_key = api_key if api_key else 'a07324c669cac4d96789197134ce272b'
        language = language if language else 'en-US'
        self.iso_language = language[:2]
        self.iso_country = language[-2:]
        self.req_language = '{0}-{1}&include_image_language={0},null'.format(self.iso_language, self.iso_country)

        self.req_api_key = 'api_key={0}'.format(api_key)
        self.req_append = append_to_response if append_to_response else None
        self.imagepath_original = 'https://image.tmdb.org/t/p/original'
        self.imagepath_poster = 'https://image.tmdb.org/t/p/w500'
        self.mpaa_prefix = '{0} '.format(mpaa_prefix) if mpaa_prefix else ''
        self.filter_key = filter_key if filter_key else None
        self.filter_value = filter_value if filter_value else None
        self.exclude_key = exclude_key if exclude_key else None
        self.exclude_value = exclude_value if exclude_value else None
        self.library = 'video'


RE: Background script with language - roidy - 2022-02-05

Hi, I've tested this with the PELLUCID skin and it works perfectly for me.

Home.xml change line 129 from

Code:
<imagepath>$INFO[Container(12341).ListItem.Art(fanart)]</imagepath>
to

Code:
<imagepath>$VAR[TMDB_Background]</imagepath>
Then at the top of Includes_variables.xml add the following so it looks like this:-

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--Skin variables-->
<includes>
    <variable name="TMDB_Background">
        <value condition="!String.IsEmpty(Container(12341).ListItem.Art(landscape))">$INFO[Container(12341).ListItem.Art(landscape)]</value>
        <value>$INFO[Container(12341).ListItem.Art(fanart)]</value>
    </variable>

    <!--folder titles-->
    <variable name="listTitle">
This will display landscape art (art with text) if it is available for the movie and is not it will fallback to standard fanart.

But remember that not all movies on TMDb have landscape art (art with text).


RE: Background script with language - kpinheiro - 2022-02-05

Good evening! That's what I did, see he brought me this image but it has text and he doesn't.

Image



He always brings this one, no text.

Image


RE: Background script with language - kpinheiro - 2022-02-05

I want him to bring me pictures with text.

Image

Image


RE: Background script with language - roidy - 2022-02-06

Did you add the changes to both files?

Are you sure you made no mistakes in the code?

The changes I posted work perfectly fine for me.


RE: Background script with language - kpinheiro - 2022-02-06

Yes, I did exactly as you asked

It brings me the image below

Image

I would like this.

Image

See the link below, there are several languages ​​and several images, but it only comes with an image without a language.

https://www.themoviedb.org/movie/774825-the-ice-age-adventures-of-buck-wild/images/backdrops?image_language=en&language=pt-BR


RE: Background script with language - kpinheiro - 2022-02-06

Test with the line below

plugin://plugin.video.themoviedb.helper/?info=upcoming&;type=movie

plugin://plugin.video.themoviedb.helper/?info=popular&;type=movie


RE: Background script with language - roidy - 2022-02-06

Here you go, using your popular link:-

https://streamable.com/yi7f9f

As I said, works perfectly.


RE: Background script with language - kpinheiro - 2022-02-06

This, this is what I want

 kkk

https://streamable.com/yi7f9f
This video turned out really good, that's what I want.

Could you share with me the xml files you changed please.

I'll just replace it, maybe I'm doing something wrong.


RE: Background script with language - roidy - 2022-02-06

https://gist.github.com/roidy/6c74826337076b5dc6eadcabf41a0447

I've also changes from a multiimage to a standard image as multiimage isn't needed.