Release plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners
(2024-01-16, 15:31)Andrea1998 Wrote: Because in different windows I need to retrieve only one piece of information, and it didn't make sense for me to create an empty container every time in each window to retrieve the information, so I use the classic Window(Home) method.

Why is creating an empty container a problem? If you put the container in an include, then it's just one line of code you need to add to the window. That's what includes are for - so you don't need to retype code blocks that you reuse....

Define the container *once* in one of your skin's include files:

xml:

<include name="TMDbHelper_Hidden_Container">
<control type="list" id="99950">
<orientation>vertical</orientation>
<width>1</width>
<height>1</height>
<left>-3840</left>
<itemlayout width="1" height="1" />
<focusedlayout width="1" height="1" />
</control>
</include>

Then whenever you want to use it in a window, it's as simple as adding a single line:

xml:

<include>TMDbHelper_Hidden_Container</include>



(2024-01-16, 15:31)Andrea1998 Wrote: I can also use the Container method to retrieve information in each window, but I read that the classic one is global and works in all windows, while the Container method doesn't, so I haven't yet fully understood whether I can use it everywhere as I want.

You misunderstand what global and local means in this context. Nothing to do with what windows either method works in. Both work identically in terms of *getting* information for an item.

What differs in how they are *setting* the information so that you can access it in the skin.
  • The container method *sets* the info to a "local" container (i.e. always in the same window as item)
  • The property method *sets* the info to "global" properties in the home window (i.e. not necessarily in same window as item)

It's nearly always preferable to use container method because working with local listitems is far more convenient than window properties. The item you are getting info for is also local so the container method is the closest to working directly with the item.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply


Messages In This Thread
RE: TheMovieDB Helper - by jurialmunkey - 2019-07-31, 11:47
RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - by jurialmunkey - 2024-01-17, 01:20
Logout Mark Read Team Forum Stats Members Help
plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners2