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

Hello @panni, as Plex has just added in its latest PMS update the ability to filter libraries content by DoVi (besides HDR), do you think we can have this feature ported to PM4K?

@panni

I use the remote control from my Sony TV (CEC).

I only use this one remote control for all devices.
Otherwise, I would have to have three to four remote controls here.

Long button presses aren’t possible because the signal isn’t sent all at once, but rather repeatedly.

Is it possible to configure the options so that I can specify which information screen I want to see when I press the button once?

But, i think I’m not the only one with this long button press problem.

Therefore, I can’t use the other functions that require a long button press.

Maybe this is a workaround for that problem:

A setting where you can choose whether you want a long press or rather repeatedly.

That’s just a CEC limitation. It works fine for other solutions like through Harmony.

Yes, i know that.

That’s why I’m asking panni if there’s a workaround for people who also use their TV remote control.

Best regards

Use Keymap addon and map long press to a specific button like the colored keys on LG remotes.

Then just press that button anytime you need to long press in PM4K or Kodi.

3 Likes

This. Reacting to multiple button presses would be a chore to implement, and there’s the Keymapper addon already.

3 Likes

0.8.0-beta11.2: script.plexmod.zip (3.0 MB)

Changelog:

  • Movies/Shows: Play custom theme if supplied in Show/Movie folder (only for mapped paths; extensions: mp3, ac3, aac, opus, vorbis, eac3, flac, alac; e.g.: theme.mp3)
  • Shows: Play custom theme even if Plex Show doesn’t have theme music

Edit: Updated zip to beta11.1, fixed regression
Edit 2: Updated zip to beta11.2

5 Likes

Good afternoon Panni, it’s great to know that you’ve resumed the project. There’s a bug I discovered yesterday. If you’re in a series or movie and hold down the back button for a long time while playing to go to the PM4K home page, if at that moment or another time you try to exit PM4K, that screen with 3 infinite loading dots appears (crashing Coreelec and forcing you to restart Kodi).

log-2025-04-12-17.44.15.zip (392.3 KB)

Another interesting thing I discovered is for those who have PM4K with path mapping and play files with more than 80mbps bitrate, the ideal is to set it to 512 KB in the SMB settings, as at 256 KB I noticed frame losses.

It’s a shame that this is too much work to implement.

But thanks anyway! (-:

Thank you very much for addressing the “theme.mp3” support.

However, no “theme.mp3” files are playing in the movie information screen in the background.

I have all the “theme.mp3” files in the respective movie folders.

But in plays perfectly in the series information screen.

Once you’ve fixed that, I have one more request.

Could you set the playback so that the song repeats continuously as long as you’re on the information screen?

Sometimes the song is already over, but you’re still on the info screen to enjoy it! (-;

Best regards!

Weird, it should, I tested it on movies. Can you supply a debug log via DM? Is path mapping active for that library?

Edit: Just tested it again, definitely works

1 Like

It works for me too on path mapped movies. It’s quite a nice feature to have for the special films in my collection.

1 Like

Now it works!

Path mapping was enabled (in settings), but I had the problem that long-pressing a button on the remote didn’t work.

Therefore, I never specified the direct links to individual films, etc., in my libraries (in the submenu).

I simply did the long-pressing of a button with a USB keyboard. That way, I could specify the direct path.

Thanks for this little, but great enhancement! (-:

PS:
Is it possible to implement that the “theme.mp3” file repeats continuously as long as you’re on the information screen?

Best regards!

After some testing, I noticed that there are some .mp3 files that abruptly stop playing at different times.

One .mp3 always ends after about 2 seconds, another always after 30 seconds, and so on.

I replaced the affected files with files that always played to the end without any problems.

These then work, too.

The affected .mp3 files play back normally in VLC or in the original Plex client.

So it’s not really the files themselves that makes problems.

Could it be a compatibility issue with some .mp3 files?

Should I send you one of these files?

Probably. I’m just supplying the files to the xbmc.Player interface. I can’t do anything besides that. If it doesn’t work well, it’s on the Kodi side of things.

It’s possible, but quite annoying to implement. I’ve tried for an hour, I’ll try again, but there’s no native playback mode that can do that, so I’ll have to implement this myself.

Good to know it’s not my fault. (-;

We also thank you for investing so much time and hope that everything works out properly.

Maybe I am sitting in the wrong train here, but regarding “theme.mp3” (for TV shows at least), Plex creates a metadata entry for TV show themes (may it be provided by Plex or by the end user via “theme.mp3” in their movie or TV show folder.

Here’s a snippet from the XML of the TV show called “Marie Brand” where I added a file called “theme.mp3” into the local TV show folder.

Plex now has it as


<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="36" librarySectionTitle="Alle Serien" librarySectionUUID="fc7cab2d-90dd-412b-af82-4f181132b80d" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1741881070">
<Video ratingKey="143624" key="/library/metadata/143624" parentRatingKey="143590" grandparentRatingKey="143589" guid="com.plexapp.agents.thetvdb://196041/1/1?lang=de" parentGuid="com.plexapp.agents.thetvdb://196041/1?lang=de" grandparentGuid="com.plexapp.agents.thetvdb://196041?lang=de" type="episode" title="Marie Brand und die tödliche Gier" titleSort="Marie Brand und die todliche Gier" grandparentKey="/library/metadata/143589" parentKey="/library/metadata/143590" librarySectionTitle="Alle Serien" librarySectionID="36" librarySectionKey="/library/sections/36" grandparentTitle="Marie Brand" parentTitle="Staffel 1" contentRating="TV-PG" summary="Eigentlich arbeitet Marie Brand (Mariele Millowitsch) im Kölner Dezernat Einbruch/Diebstahl. Vor Jahren hatte sie die Mordkommission verlassen, nachdem ihr Vater im Einsatz getötet worden war. Als sie nun aber zu einem Einbruch mit Todesfolge gerufen wird, ist sie plötzlich schneller wieder in einen Mordfall verwickelt, als ihr lieb ist. Marie ist als Einzige davon ĂŒberzeugt, dass der Einbruch bei dem Anwalts-Ehepaar Jeanette und Hajo Fischer (Lavinia Wilson, Götz Schubert) nur inszeniert wurde, um den Mord an der GĂ€rtnerin Julia (Alexandra Schalaudek) als zufĂ€llige Folge darzustellen. Gemeinsam mit dem eigenwilligen Kommissar und Frauenheld Simmel (Hinnerk Schönemann) verfolgt Marie die Spur zu einer Meditationsgemeinschaft namens Numa zurĂŒck, bei der sowohl die Tote als auch die Fischers Mitglieder waren. Hat diese Glaubensgemeinschaft etwas mit dem Mord zu tun? Die Mitglieder – allen voran die GruppenfĂŒhrerin Laura (Katharina Lorenz) – verhalten sich jedenfalls konspirativ und geben nichts von sich preis. Bald findet Marie heraus, dass auch Hajo Fischer und seine Frau Jeanette nicht nur Opfer sind. Fischer ist mit seiner neuen Kanzlei tief in den Strukturen der Glaubensgemeinschaft verankert. Seit er vor Jahren die ominöse Meisterin bei einem Prozess um ein Kleinkind freigeboxt hat, kĂŒmmert er sich um deren Finanzen. Hat er dabei Gelder veruntreut? Sinnt die Meisterin nach Rache? Galt der Mord also eigentlich Hajo Fischer? FĂŒr Marie spricht vieles dafĂŒr, denn vor allem Jeanette fĂŒrchtet spĂŒrbar um ihr Leben. Marie muss sich in dieser fĂŒr sie unbekannten Welt aber erst einmal zurechtfinden. WĂ€hrend sie ihre speziellen Hochbegabten-FĂ€higkeiten einsetzt, baut Simmel ganz auf seine pragmatische, mĂ€nnliche Logik. Als beide in letzter Sekunde einen Mordanschlag auf Hajo Fischer verhindern können, stellt sich die Frage, von wem die eigentliche Gefahr ausgeht. Ausgerechnet die in Amsterdam verweilende Meisterin gibt Marie den entscheidenden Hinwe" index="1" parentIndex="1" rating="10.0" viewCount="3" lastViewedAt="1568378408" year="2008" thumb="/library/metadata/143624/thumb/1680509659" art="/library/metadata/143589/art/1736360555" parentThumb="/library/metadata/143590/thumb/1670682020" grandparentThumb="/library/metadata/143589/thumb/1736360555" grandparentArt="/library/metadata/143589/art/1736360555" grandparentTheme="/library/metadata/143589/theme/1736360555" duration="5349120" originallyAvailableAt="2008-12-17" addedAt="1670678864" updatedAt="1680509659">

You can find the “grandparentTheme” parameter which points to a folder. -i don’t know where to find that folder, but to me, it looks like Plex may be copying that file and uses that copy?

How to change the order of Hubs on the homescreen? As in move Recently Added Movies above Recently Added TV?

I searched the thread for a possibility to hide libraries from my own user’s view and found a reference to @panni planning such a feature in the v0.6something area around the end of 2023.

Is this possible? If yes, then how to?

If not, this would be my no. 1 wish for UI - since I see libraries that I set up especially for other home users and libraries no longer in active use, etc


It would be great to be able to set and unset the libraris as visible or unvisible on a per-user base.

Thank you in advance and sorry if I missed the implementation of such a feature.

Maybe you could check if music theme is still running and restart the theme once the user navigates within a TV show (changing from show to season level or back, changing seasons or episodes view, etc.) - but only if playback stopped.

And maybe give us an option to allow or avoid “music theme repeat”.

Not the same as continuous play but better than nothing?

You can hide libraries already; long press on a library icon. You can also do the same with hubs.

Interesting. It’s a default feature as long as you have local media assets enabled: https://support.plex.tv/articles/200220717-local-media-assets-tv-shows/

I’ll check how that’s handled. Maybe there’s no need for path mapping (if you stick with theme.mp3 and don’t want any other audio extensions).

Edit: Yeah, works when Use Local Assets is enabled for a library, followed up by a metadata refresh

Edit 2: Yep, so if you enable local assets in your library and add a theme.mp3, Plex will pick that up as the new theme and will store it internally. PM4K, like any other client, will then play that theme instead. You only need path mapping in PM4K if you want any other format than MP3 for custom theme music.

1 Like