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

Hi @panni, Happy new year. is this possible in the future- the ability to use a custom build skin player osd so we can switch VS10 mode via player osd menu when playe starts? Thanks.

@panni,Hello I’ve faced an issue that the PM4K couldn’t make an update for some reason I did format my device and reinstalled the CE system then installed PM4K usually when changing update source to beta pop message new update latest update but since 2 days up to now I can’t receive a new update. I’m stuck on 0.8.0 beta4.7

Have you tried rebooting CoreELEC? I think that’s what I have to do to pick up the beta updates when PM4K is opened.

of course many times I did it but same problem couldn’t receive an update.

Automatic update to latest beta, 2x regressions that went away once I downgraded.

  1. I have show ratings on for both TV and Movies. But on newest beta the TMDB badge has disappeared from the episode screen even with all the ratings turned on:

  2. VOBSUBs aren’t showing up for me in latest beta. Worked once I downgraded back to beta 4.6

Your screenshot shows a TMDB badge, or am I missing something?

What does that mean? Where? And did you check the forced subtitle fix changes in 6.7?

I’ll need logs via DM (DEBUG enabled)

Probably not possible. I’ll have to add custom build specific features manually to skin.plextuary.

It’s currently set to 4 seconds, hardcoded (+/- 1 second). I’ll add an AddonSetting in the next beta.

1 Like

OK, I’ve also found a way to reduce blocking, e.g. ā€œthree dotsā€ (by open server connection requests) when exiting the addon. With the default setting for max retries (3), this can improve the time it takes to exit two-fold. Technical background: When an exit is triggered, all request retries are set to 0, so only the currently open ones will still time out (if there is a timeout), but they won’t be retried.

This should also fix updater issues.

Also, the updater now waits for the UI to close for longer (based on max retries and timeout settings), dynamically.

A good couple of core changes are in this release as well, so please be aware of new issues.

Of course, the new fixes for the updater will not apply to this update, as you’re still running the older one.

0.8.0-beta6.8: script.plexmod.zip (3.1 MB)

  • AddonSettings: Make OSD hide delay configurable (only works for Plextuary or other skins with configurable OSD timeout); default: 4s (+/- 1s)
  • Core/Home: Stop retrying requests when shutting down/exiting
  • Core/AddonSettings: Lower default requests read timeout to 5s (was 10s)
  • Core/Updater: try killing the script if UI close timeout reached
  • Core/Updater: calculate the timeout to wait for the UI to close dynamically based on requestsTimeoutConnect * maxRetries + requestsTimeoutRead + 2
  • Core/PlexServerManager: Use CONN_CHECK_TIMEOUT for local connection tests as well
  • Core/Settings: Expose default settings globally
  • Core/Settings: Remove (hopefully) all calls to getSetting with a default set
  • Core/Logging: Move KodiLogProxyHandler to lib/logging; Add debug-logging for urllib3 when debug requests is on
  • AddonSettings: Add toggle to debug requests
8 Likes

I’ve just started using this, and everything seems fairly smooth so far, but I’ve run into a couple of fairly debilitating issues. @panni

The first one I reported on GitHub yesterday: Folder view occasionally glitches and doesn't actually show folders Ā· Issue #179 Ā· pannal/plex-for-kodi Ā· GitHub

The second one, certain files seem to cause the screen to render entirely black - I get audio, but I’m not able to get any video, and even the UI refuses to render when this happens. Is this a known bug? Both of the files this happens with are listed as DV P8.1 HDR HEVC DD+ ATMOS 5.1 MKVs, but I have another file with the exact same markings that works with no issue at all.

Both of these occur on the stable branch as well as the 0.8.0 beta. Happy to provide logs, but I’m unsure on how to export them after ticking the option.

Many thanks

EDIT: It looks like both of these files are using HDR10+ rather than just standard HDR10 (which is used on the file that does work). Disabling HDR10+ in Kodi works, but this isn’t really ideal…

Kodi is the renderer/video player, not PM4K. We’re just a sophisticated overlay. I can take a look at your Kodi logs (via DM), but I can’t do anything about video playback or why you get a black screen.

PM4K logs into the kodi log, so please look at the kodi wiki on how to obtain your logs in your specific case.

@panni I’ve looked into this more and you’re right, the issues are with Fire Sticks rather than PM4K. Would it be possible to look into the first issue I mentioned, whereby folders sometimes show 5 blank files until I go out and back in? There’s a video linked in the GitHub issue. My logfile from the session where it just happened is here: hastebin

The screenshot is from the old version that works. The newest beta doesn’t have it.

What does that mean? Where? And did you check the forced subtitle fix changes in 6.7?

The selected sub isn’t showing up in playback. The same selected sub shows up in prior versions.

For me it does. Weird.

Edit: Wait, that’s an unwatched episode. What are your no TV Spoilers settings?

So the subtitle is correctly selected but the actual content doesn’t show? Do you have logs for me?

Having spent a while longer troubleshooting this, the only further info I’ve found is that it happens regardless of skin, and also happens in list view. Unfortunately I’m not able to understand much of the logs myself, so any help at all in fixing this bug would be appreciated!

I would assume the relevant lines of this log (which is a different log to the above, but has the same bug) are the below, but I’m not sure what info this gives, if any:

2025-01-08 00:13:33.940 T:32313   debug <CSettingsManager>: requested setting (viewtype.19af0ec866b6ba8cff24f7d878ef2a9587a4e1ec.2) was not found.
2025-01-08 00:13:33.951 T:28169   debug <general>: Activating window ID: 13006
2025-01-08 00:13:33.952 T:28169   debug <general>: ------ Window Deinit (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-posters.xml) ------
2025-01-08 00:13:33.952 T:28169   debug <general>: ------ Window Init (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-blank.xml) ------
2025-01-08 00:13:33.952 T:28169    info <general>: Loading skin file: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-blank.xml, load type: LOAD_ON_GUI_INIT
2025-01-08 00:13:34.085 T:28169   debug <general>: Activating window ID: 13007
2025-01-08 00:13:34.085 T:28169   debug <general>: ------ Window Deinit (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-blank.xml) ------
2025-01-08 00:13:34.085 T:28169   debug <general>: ------ Window Init (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-posters.xml) ------
2025-01-08 00:13:34.085 T:28169    info <general>: Loading skin file: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-posters.xml, load type: LOAD_ON_GUI_INIT
2025-01-08 00:13:34.104 T:28169   debug <general>: [Warning] CGUITextureManager::GetTexturePath: could not find texture '-'
2025-01-08 00:13:34.210 T:32313    info <general>: Skipped 11 duplicate messages..
2025-01-08 00:13:34.210 T:32313    info <general>: script.plexmod: API: GET https://192-168-0-93.32e879c23d4b44d0bcd075e0dd506cc1.plex.direct:32400/library/sections/2/folder?parent=2067/all&includeCollections=1&sort=titleSort%3Aasc&X-Plex-Container-Size=0&X-Plex-Container-Start=0&X-Plex-Token=****
2025-01-08 00:13:34.249 T:32389    info <general>: script.plexmod: BGThreader: (queue.0:worker.0): Active
2025-01-08 00:13:34.253 T:32389    info <general>: script.plexmod: BGThreader (queue.0:worker.0): Idle
2025-01-08 00:13:34.352 T:32392    info <general>: script.plexmod: BGThreader: (queue.0:worker.0): Active
2025-01-08 00:13:34.353 T:32392    info <general>: script.plexmod: API: GET https://192-168-0-93.32e879c23d4b44d0bcd075e0dd506cc1.plex.direct:32400/library/sections/2/folder?parent=2067/all&includeCollections=1&sort=titleSort%3Aasc&X-Plex-Container-Size=240&X-Plex-Container-Start=0&X-Plex-Token=****
2025-01-08 00:13:34.426 T:32392    info <general>: script.plexmod: BGThreader (queue.0:worker.0): Idle

Similarly, this log has it set to list view rather than showing it in squares, and the relevant lines should be the below:

2025-01-08 00:20:40.322 T:28169   debug <general>: ------ Window Deinit (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-listview-16x9.xml) ------
2025-01-08 00:20:40.322 T:28169   debug <general>: ------ Window Init (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-blank.xml) ------
2025-01-08 00:20:40.322 T:28169    info <general>: Loading skin file: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-blank.xml, load type: LOAD_ON_GUI_INIT
2025-01-08 00:20:40.454 T:28169   debug <general>: Activating window ID: 13007
2025-01-08 00:20:40.454 T:28169   debug <general>: ------ Window Deinit (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-blank.xml) ------
2025-01-08 00:20:40.454 T:28169   debug <general>: ------ Window Init (/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-listview-16x9.xml) ------
2025-01-08 00:20:40.454 T:28169    info <general>: Loading skin file: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plexmod/resources/skins/Main/1080i/script-plex-listview-16x9.xml, load type: LOAD_ON_GUI_INIT
2025-01-08 00:20:40.474 T:28169   debug <general>: [Warning] CGUITextureManager::GetTexturePath: could not find texture '-'
2025-01-08 00:20:40.583 T:1473     info <general>: Skipped 11 duplicate messages..
2025-01-08 00:20:40.583 T:1473     info <general>: script.plexmod: API: GET https://192-168-0-93.32e879c23d4b44d0bcd075e0dd506cc1.plex.direct:32400/library/sections/2/folder?parent=519/all&includeCollections=1&sort=titleSort%3Aasc&X-Plex-Container-Size=0&X-Plex-Container-Start=0&X-Plex-Token=****
2025-01-08 00:20:40.608 T:1593     info <general>: script.plexmod: BGThreader: (queue.0:worker.0): Active
2025-01-08 00:20:40.623 T:1593     info <general>: script.plexmod: BGThreader (queue.0:worker.0): Idle
2025-01-08 00:20:40.712 T:1596     info <general>: script.plexmod: BGThreader: (queue.0:worker.0): Active
2025-01-08 00:20:40.713 T:1596     info <general>: script.plexmod: API: GET https://192-168-0-93.32e879c23d4b44d0bcd075e0dd506cc1.plex.direct:32400/library/sections/2/folder?parent=519/all&includeCollections=1&sort=titleSort%3Aasc&X-Plex-Container-Size=240&X-Plex-Container-Start=0&X-Plex-Token=****
2025-01-08 00:20:40.795 T:1596     info <general>: script.plexmod: BGThreader (queue.0:worker.0): Idle
2025-01-08 00:20:41.331 T:28226   debug <CSettingsManager>: requested setting (auto_update_check) was not found.

I was waiting to reply to this when I had logs, but since I upgraded my SD card about the time you replied to me I haven’t gotten the error! When I did that it noticeably decreased all my load times, so maybe there’s a race condition in there? Will still upload the second I’m able to reproduce.

OK, this might be somewhat massive for a beta release.

There’s been code that has rarely really been touched before. Especially in the asynchronous area of ā€œrequestsā€ (the stuff that queries your Plex server). From what I was able to gather, many of the ā€œthree dotsā€ exit issues (and Kodi crashes), stem from very early implementations that remained unchanged for almost a decade.

I’ve tried to address that with this (and previous) version(s). Please report back if you can’t connect to a server that you’re normally able to connect to. I don’t expect any major issues, but please be aware of this.

Other than that, there’ve been a couple of fixes and additions, as you can see below.

0.8.0-beta7: script.plexmod.zip (3.1 MB)

  • Home: Fix fast user/server switching not working when manual user switch was initiated but canceled
  • Home: When directly resuming or playing an item from home, return to home after playback finished instead of visiting the item
  • Movies/Preplay: Show reviews based on watched state and setting
  • Shows/Seasons/Episodes/Movies: Add option to refresh PMS metadata (if user is admin) (ā€œRefresh metadataā€)
  • Episodes: When always resume is enabled and episode is resumable, show start-over option in episode context menu
  • Episodes: When always resume is enabled and episode is resumable, show resume/start-over dialog on CONTEXT_MENU/long-press OK on Play button
  • Libraries: Fix folder view ITEM_TYPE not being retained after hitting back button (thanks @bowlingbeeg)
  • Settings: Replace ā€œShow reviewsā€ with ā€œShow reviews forā€ (default: Unwatched, Watched); resets previous setting
  • GUI: Rename all instances of (un)watched to (un)played (to conform to Plex)
  • Kodigui: Add window instance to debug log in case of runtimeerror
  • Core/AsyncAdapter: Allow extension of socket deadline in case of EINPROGRESS exactly once, then count towards connect timeout (was: possibly indefinite)
  • AddonSettings: Lower default marker auto skip offset from 2.5 to 1
  • Core: Don’t use explicit sock.shutdown(socket.SHUT_RDWR), instead rely on sock.close(); might fix ā€œthree dotsā€ on exit
  • Core: Log Async connection-relevant info when Debug requests is enabled

tl;dr: This should fix most exit/quit kodi issues.

Edit 2: This might be snappier than any instance of PM4K you’ve ever experienced. Especially when exiting. Depending on the hardware you’re using, of course, and if you have a ā€œdeadā€ Plex server in your Plex account, as we’re not blocking a thread potentially indefinitely, anymore, for ā€œhangingā€ connections (very network specific and might not often be the case).

13 Likes

Can you add watchlist (German: Merkliste), like original Plex?

Yeah, already working on that :slight_smile:

9 Likes

0.8.0-beta7.1b: script.plexmod.zip (3.1 MB)

  • Core: Fix HTTPConnection was never async. Unify Asynchronicity between HTTPConnection and HTTPSConnection via AsyncConnectionMixin
  • Core: Correct slots

Yes, you heard correctly. HTTP connections (not HTTPS connections) were never asynchronous to begin with.

Edit: You probably won’t notice this, as HTTP usually is only enabled for local/LAN connections and thus they don’t block for long.

10 Likes

@panni

any news about rearrange home screen with movies first? thanks :slight_smile:

I’ve been out of the loop for a little while. Loving the updates from late last year and this new one. Being able to scan library files directly from Kodi is a nice touch.

You mentioned dead Plex servers there. How do we get rid of them? Because I have 2 of them now :joy:

1 Like