Kodi Community Forum

Full Version: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Got a weird issue using $INFO[Container(99950).ListItem.Property(Next_Aired.Long)] or $INFO[Container(99950).ListItem.Property(Last_Aired.Long)] on my Shield TV but not on my Windows PC.

PC -

Image

Shield TV -

Image

As you can the day date shows -d on the Shield TV for some reason.

Any ideas?

Thanks.
(2023-12-17, 06:46)mikeSiLVO Wrote: [ -> ]I noticed that some ListItem.Property(RottenTomatoes_Image) are empty. I just recently started using an mdblist API key so I think it has to do with that.

It's been a while since I touched that part of the code, but RottenTomatoes_Image is only available with OMDb key as far as I remember. MDbList will get the ratings but it doesn't supply an image code afaik.

I normally just use a variable to fallback to checking if the score is under 59 to display rotten image:
https://github.com/jurialmunkey/skin.arc...498C1-L504

Note these extended ratings are only available from the detailed item. They won't be available directly from a standard list like recommendations; but you can get them for focused item in a list via service monitor.
(2023-12-17, 21:18)Hitcher Wrote: [ -> ]Got a weird issue using $INFO[Container(99950).ListItem.Property(Next_Aired.Long)] or $INFO[Container(99950).ListItem.Property(Last_Aired.Long)] on my Shield TV but not on my Windows PC.

As you can the day date shows -d on the Shield TV for some reason.

Yep, this is a frustrating issue. The strftime directives with hyphens like "%-d" are platform specific as mentioned here: https://strftime.org/

The issue is that Kodi hardcodes a "fix" based upon the assumption that Windows is the only platform that uses a different directive ("%#d" in Win).
https://github.com/xbmc/xbmc/blob/ca903e...#L240-L245

Kodi assumes that everything else supports the Linux/Unix style "%-d". However, clearly Android doesn't (or at least not correctly) despite being Linux based.

TMDbHelper is acting correctly according to the information it is getting about the region datelong formatting string - it's just either the string is wrong for the platform, or the platform is not supporting the directive correctly. Not 100% sure if it's something that needs to be fixed in Android or Kodi as I don't use Android myself and I can't really find any Android specific strftime documentation.
The odd thing is it used to work.

EDIT: Even weirder - I just restarted Kodi checked as show straight away and when the date loaded it was correct for a second and then changed to -d!
Looks like I'll have to use variables based on Next_Aired.Short and Next_Aired.Long.
(2023-12-18, 22:23)Hitcher Wrote: [ -> ]Looks like I'll have to use variables based on Next_Aired.Short and Next_Aired.Long.

For the service you can use the custom formatting string:
Code:

Skin.SetString(TMDbHelper.Date.Format,%d %B %Y)

Code:

$INFO[Container(99950).ListItem.Property(last_aired.custom)]
$INFO[Container(99950).ListItem.Property(next_aired.custom)]

That will give 0 padded version e.g. "09 September 2023"

Obviously a bit annoying since it doesn't use the user's long date settings but you could offer them the option to set it themselves and use a $VAR to fallback to standard long date if they haven't.

Note that the custom format defaults to "%d %b %Y" (which is "09 Sep 2023") if the setting string is empty -- so make sure to check against the setting string rather than the output property.

I thought I'd documented this in the wiki, but it looks like I haven't (or at least I can't remember where I put it).
EDIT: Okay, I did document it! I wasn't going mad! Just found it:
https://github.com/jurialmunkey/plugin.v...properties
Thanks for the pointers. I've managed to get the format style I want working using the following -

Skin.SetString(TMDbHelper.Date.Format,%d %B %Y)
+
$INFO[Container(99950).ListItem.Property(Next_Aired.Day),,$COMMA ]$INFO[Container(99950).ListItem.Property(Next_Aired.Custom)]
=
Monday, 18 December 2023
Hi @jurialmunkey

Can I ask if you can add saving views?

Several addons have an option to save views.

Example:

Movie -> Fanart View
TV Shows -> Wall View
Episode -> List View

In this way, every time a new page is opened, the current view remains and does not return to the default one.

I think it's the only thing missing in this very complete addon.
I hope it is not an element that can create problems in the code.

Thank you for your help.
@Andrea1998 -
No, because viewtypes are UI and UI is the domain of the skin. Plugins should only serve metadata and leave UI design choices to the skinner.

A plugin forcing viewtype IDs is hack attempting to patch over missing skin functionality which is better addressed in the skin itself. If you want locking viewtypes based on content, then you should discuss with the skinner of your skin about implementing that functionality.

There are several different approaches which can be used to achieve this behaviour in a skin. For instance, my addon SkinVariables provides some tools to achieve this: https://github.com/jurialmunkey/script.s...pe-Builder -- However, viewtype locking can also be achieve natively using only skin code. For example, Eminence 2 had locking viewtypes done with native skin code and I made that skin more than 8 years ago.
(2023-12-21, 00:54)jurialmunkey Wrote: [ -> ]There are several different approaches which can be used to achieve this behaviour in a skin. For instance, my addon SkinVariables provides some tools to achieve this: https://github.com/jurialmunkey/script.s...pe-Builder -- However, viewtype locking can also be achieve natively using only skin code. For example, Eminence 2 had locking viewtypes done with native skin code and I made that skin more than 8 years ago.
Thanks, I wasn't aware of this behavior.

I said this because most add-ons behaved this way.

But now I understand that the best thing to do is as you told me, and I thank you very much.
I am using latest Arctic Fuse Skin on my Shield 2019 Pro with latest Maven Omega Build and noticed some interesting Problem with the TMDBHelper Addon.

A lot of my movies and also Moviesf from Collection and also running on LiveTV have "Master usere" and Version 20.90.821 standing in the line in the Top where Year, Gemre, Runtime etc. is

All Stuff with that Master user in doesn´t fetch any Ratings using OMDB API.

Series are working fine all the way Wink
@jurialmunkey

Can I ask you if it is possible to add in the service monitor blur image section, the possibility of inserting an image coming from an infolabel?

In this way I hope it is faster in obtaining the image with blur, this is because a small delay is created when scrolling through a list of different movies set in this way:

xml:
<onload>SetProperty(TMDbHelper.Blur.SourceImage,Art(fanart),Home)</onload>
$INFO[Window(Home).Property(TMDbHelper.ListItem.BlurImage)]

If instead you can take an image locally, e.g. $INFO[ListItem.Art(fanart)], generating this:

xml:
<onload>SetProperty(TMDbHelper.Blur.SourceImage,$INFO[ListItem.Art(fanart)],Home)</onload>

I think it would be faster to generate the blurry image.

Furthermore the delay is even greater with the output image:

$INFO[Window(Home).Property(TMDbHelper.ListItem.BlurImage.Original)]

or is it possible to preload the output blur image somehow?

I get a preload with $INFO[ListItem.Art(fanart)] by placing it in <itemlayout>, but I can't do it using $INFO[Window(Home).Property(TMDbHelper.ListItem.BlurImage)] as the image output is always the one in focus.


Thank you for your help.
@jurialmunkey

after todays Arctic Fuse Update the problem seems to be solved and everything is working fine now Wink
I am on Kodi 20.2, and for a few days now I have been unable to play anything. Kodi loads fine and scrapes with no problems. When I try to play a video it either does nothing or plays for a few seconds then freezes. I have tried clearing the cache, force stopping, and even doing a restore of an earlier backup, and still the same results. I am on AH2. Here is the log....https://paste.kodi.tv/zohoxuhaza.kodi
(2024-01-10, 06:58)jjdontplayz Wrote: [ -> ]I am on Kodi 20.2, and for a few days now I have been unable to play anything. Kodi loads fine and scrapes with no problems. When I try to play a video it either does nothing or plays for a few seconds then freezes. I have tried clearing the cache, force stopping, and even doing a restore of an earlier backup, and still the same results. I am on AH2. Here is the log....https://paste.kodi.tv/zohoxuhaza.kodi
No help here with banned addons.