PM4K / PlexMod for Kodi (18, 19, 20, 21, 22+)

Pretty sure all official clients still request all metadata when you visit things. They might not have to build certain GUI elements or re-download the posters and assets, and probably “feel” a little faster, as they might cache specific views and then lazily update them.

That’s a little more sophisticated than what we do, but not by much, as Kodi takes care of caching the assets for us. It won’t meaningfully reduce the load on the PMS.

That’s also not how this client/server relation is intended to work. I’m still not sure why you’re worried about the load on your PMS. Any rpi3 does just fine when paired with fast storage for its data folder.

If you want a client that’s more “cachy”, you should use PKC. It’ll still query the PMS, though.

Edit: I get the feeling you’re using a remote PMS and the admin told you that your client puts more load on the server compared to everybody else.

Hmm OK. I’ll add it to my list. Could be possible or could mean a whole rewrite of the home view to support this.

I noticed that this subtitle confusion only happens when there is a .srt file in the folder and only when using SMB with path mapping active, regardless of whether it was downloaded during the movie, or before opening the movie on the PC itself, etc.

When using standard HTTP, this problem does not occur.

I still don’t understand. The AndroidTV client does it the same way PM4K does it - what shows up in Home is a server side control and it’s by library:

Ok guys, the aspect ratio branch has finally been merged, together with a couple of other fixes.

0.7.9-prerelease1: script.plexmod.zip (2.8 MB)

Some background
Unlike Kodi skins, plugins bringing their own GUI don’t benefit from the modern features skins have, which means there’s no real support for anything other than 16:9.

Luckily, as we’re using the templating engine since 0.7.9-beta, we can dynamically build our GUI based on the display we’re seeing. In order to properly scale the UI for lower aspect ratios, such as 16:10 or 4:3, we still render our interface at 1080p (16:9) and let Kodi stretch it to the current display, but we vertically shrink and reposition our elements proportionally to the aspect ratio difference, so it looks exactly like it should in the end.

The logic is quite easy:

    hratio = 1080 / float(1920)
    hratio2 = h / float(w)
    v_ar = hratio / hratio2
    final_height = v_ar * height

This meant, though, that every single vertical position and height definition (and animations) in the GUI had to be checked and most of them replaced with the dynamically scaled counterparts, which was a ridiculous amount of work (luckily, 90 % of which could be realized by using smart regexes in PyCharm). I also had to expand the featureset of our templating engine (Ibis-fork) once again, which is why this took so long.

If you’re using a standard 16:9 aspect ratio, you will hopefully not notice anything using this release. Every 16:10/4:3 user should, though.

Widescreen (bigger aspect ratios) will come in the future, but scaling horizontally is a little more complicated.

Thanks @FortKnox1337 for sticking with me during the solution and execution phase over the last month or so!

Please report any issues you encounter!

Temporary Changelog:

  • Core/GUI/Templating: Smaller aspect ratio support (16:10, 4:3, …)
  • Core/MyPlex/UserSettings: Use cached user/account while waiting for plex.tv response; fixes episode playback errors with bingeMode setting
  • Core/PlaybackManager: Allow ACCOUNT.ID to be None to not fail on pbs.bingeMode in certain (rare) situations
  • Core/Networking/MyPlex: Adhere to max_retries when querying myplex; adhere to PLEXTV_TIMEOUT_READ (default: 20s) when doing so (used LONG_TIMEOUT=20 as a fixed value before)
  • Core: Add singleton from tendo library; add LICENSE; make singleton py2 compatible (hopefully)
  • Core/Main: Make absolutely sure we never run more than one instance at a time (via tendo.singleton locks)
  • Core: Fix GlobalProperty context handler
  • Core/Main: Round aspect ratio to 2 decimal points
  • Core: Add info to splash in log whether we need scaling or not, and the current aspect ratio
  • Episodes: Visually fix resume point still showing after rewinding to a non-resume-worthy point (<60s) in a video that had a resume point
  • Music Libraries: Fix filters erroring
  • Dropdown/Libraries: Fix visual scrolling issues on dropdowns with many items (e.g.: Genres)
  • Dropdowns: Be smarter when we’re trying to display a dropdown that’s out of bounds
  • Episodes: When watching multiple episodes in a row, completely, until the end of the season, select the last episode in the season when returning from playback
  • Templating/Postplay: move hubs up a little (scaled)
  • VideoPlayer/Postplay: Fix vertical positioning of hubs to be about the same as in Movie/Preplay view
  • Player/SeekPlayerHandler: Possibly harden further against bad timeline events
  • Player/Audio: Fix zero-duration error; fix seeking impossible

Edit: Oh yeah, this is prerelease1, and I forgot to ping The Squad™: @sonofdibnah @ecsjjgg @jamal2367 @THGhost @bowlingbeeg @Buttzy10169 @SmarthyMcFly @pl37919

Edit 2: Adding @FortKnox1337 to The Squad™

6 Likes

My shield Plex home page layout looks different on the native app versus my Ugoos PM4K homepage. The PM4K home page doesn’t show all my libraries like the native Plex app does. It just shows some.

That could be the case, sure. We might not parse certain libraries in your home view. Please DM me the output of https://yourplexserver:32400/hubs?X-Plex-Token=YOURTOKEN and tell me which hubs you don’t see.

That’s expected, though.

Please test this thoroughly, guys, as we’re approaching 0.7.9 release :slight_smile:

3 Likes

Everything is working fine: Tested through the windows Kodi 21.1

https://mirrors.kodi.tv/test-builds/windows/win64/KodiSetup-20240817-183eb85f-Omega-x64.exe

Only error received below from debug enabled, but the Interface is Stable.
But it seems info not an error.

2024-08-17 15:04:47.318 T:13984    info <general>: script.plex: VideoPlayer: Starting post-play
2024-08-17 15:04:47.318 T:13984    info <general>: script.plex: API: GET https://xxx-xxx-xx-xx.xxxxxxxxxxxx.plex.direct:32400/hubs/metadata/498934/postplay?X-Plex-Token=****
2024-08-17 15:04:47.527 T:13984    info <general>: script.plex: API: ERROR: FATAL: Container address is not an expected path: 
2024-08-17 15:04:47.530 T:13984    info <general>: script.plex: PostPlay: Showing video info

Thanks

1 Like

I don’t often bring up the video/system info so not sure when the bug was first introduced but is anyone else seeing that “System CPU usage” isn’t positioned properly?

It is possible it might be limited to the 16:10 UI Scaling though as I just tested the same thing on my Kodi PC in 16:9 AR and it showed up fine.

16:10

16:9

EDIT: Also, thanks @panni for the promotion. :smiley:

3 Likes

Thanks, I’ll check!

Everything fine so far :+1:t2:
Tested primarily music and movies.

1 Like

0.7.9-prerelease2: removed, see prerelease2.2

A little maintenance run, some episodes improvements and an AR fix.

Temporary Changelog:

  • Episodes: After fully watching the last episode of a season, select the next unwatched episode of the next season, automatically, after returning to the episodes view
  • Postplay: Fix cosmetic "API: ERROR: FATAL: Container address is not an expected path: "
  • Player/Episodes/Seekdialog: Always correctly select the currently playing item in the current playlist
  • SeekDialog/PPI: Correctly position CPUUsage when scaled
  • Core: Separate version info and global property handling from util.py into kodi_util.py
  • Core/Boot/Entrypoint: Make entrypoint leaner by only importing what’s necessary
  • Core/Boot/Entrypoint: Use both tenga.singleton and global “started” property on Window(10000) to determine whether we’re already running
  • Core/Mainloop: Clean up global properties
  • Core/Reactivate/Maximize: If unable to reactivate plugin, exit cleanly
  • Templating/Filters: Fix cosmetic float typo
2 Likes

Can confirm this issue is fixed now. Thanks @panni :slight_smile:

1 Like

Yeah, looking at your XML, /hubs doesn’t include what you see on the other Plex clients. This means they query the home view differently. I’ll add it to my list and will investigate after/at 0.8.0, but this will take time. Thank you for the details!

It means it’s not queried, so also not cached (if we had a data cache).
There’s no active data cache apart from posters/assets.

BTW, I’ve been looking at the requests official Plex clients do - they do way more requests than us, at least on the home view (because they support more modes compared to us). PlexWeb requests about 5x more data than PM4K.

0.7.9-prerelease2.1: removed, see prerelease2.2

Hello :slight_smile:

Temporary Changelog:

  • Core/Boot/Kiosk: Allow delaying autostart/kiosk-mode; allow manual immediate start when requested
  • Settings: Move autostart/kiosk-mode to Main (was in: System)
  • Settings: Add setting to allow a delay for the autostart/kiosk-mode
  • Settings: Post play Auto Play: Honor postplay timeout in setting description (addonSetting; default: 16s)
  • Settings: Add user-setting to never show Post Play (default: off)
6 Likes

Everything seems good on my side with OSMC.

1 Like

More of a feature request.
I wonder if this would be possible.
With the Plex client, when I click on an actor, I see all the movies and TV shows the actor had a role in. With PM4K, I need to choose between my different libraries - Kids, Non-Kids, TV, or Movies.
It would be nice if it would just show all, or at least all movies and all TV shows.
And I’m also missing the actor bio that you see with Plex native.

3 Likes

Hmm, I agree that the actor-related features are treated a little like orphans. I usually compare against PlexWeb/Plex for Windows and its featureset - which IMO is even worse than ours.

I haven’t used the Android TV Plex client for ages, how does it display actor info?

There seems to be some issues with prerelease 2 and 2.1. I can only seem to play Episodes from the final season of a TvSeries, Tried to play from season 4 but keyboard actions didn’t work and no episodes would play but from season 5 of the same series I could select and play. I had to revert to prerelease 1.

Here’s the log:

kodi-bug.log (889.6 KB)

1 Like

Oof, yeah, oversight on my part. Sent you a test build via DM.