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

Can u run Kometa on windows ?

https://kometa.wiki/en/latest/kometa/install/local/#__tabbed_1_3

Before anyone asks: I’m aware of the new watched/unwatched visuals :slight_smile:

image

As announced, I’m working on the new theme engine; please bear with me.

6 Likes

I’ll ask for this at some point when you’re not so busy. Any chance of adding ā€œScan Library Filesā€ to the Choose action for: panel for each library?

Whenever. No pressure.

2 Likes

That would be a very usefull feature - would also appreciate if implementable.

Oh good idea! Definitely a feature that could come in useful if it is possible.

Also quick question @panni. I’m not sure if it’s a bug or if it’s normal behaviour but if you have ā€œBehave like official Plex clientsā€ enabled under Player UI should it still be honouring the options set under the Playback (user-specific) section?

Reason I ask is that I currently have ā€œShow video chaptersā€ and ā€œUse virtual chaptersā€ disabled however it still shows the option for chapters when pressing the up button.

At least for me It can sometimes get in the way when wanting to go up to the Skip Credits button as I have to sort of press the up button twice and then press down to get to it. Once to show chapters and then a second time to go up to the chapters to select them and then I have to press down for it to highlight/select the Skip Credits button.

I really hope that made sense as I was even confusing myself typing it. :smile:

Great suggestion, went right on my shortlist.

Hmm not sure I understand this completely. You’re saying you’ve enabled ā€œBehave like official Plex clientsā€ (which currently enables accessing chapters via Down), but for shows where you’ve disabled chapters the functionality is still enabled?

If that’s so, that’s a bug I guess. I’ll double check.

Yeah that is what I was trying to get at. Glad you mostly understood. Sorry about that. :smile:

FYI, yes, development is still going on. There’ll be a pretty massive new beta in the coming days. I’ve built the aforementioned templating engine.

7 Likes

I’ve unfortunately come across another bug, using 0.7.9 beta 7.1 (and beta 6.2 as I forgot to update to 7.1 apparently) I started the next episode playing from the play button on the season select screen, then when backing out of the playing episode to the TvSeries season select screen and pressing the play button I don’t get any option to continue from where I left off or start from beginning like you would usually get and the episode doesn’t play.

There are no errors in the log and it just seems like the play button doesn’t respond to clicks \ presses.

These are the log lines from episode stop to attempting to play again, I don’t think there’s anything useful in them though:

2024-07-04 20:49:22.331 T:1507     info <general>: script.plex: VideoPlayerWindow: Session ended - closing (ID: 140618191035856)
2024-07-04 20:49:22.331 T:1507     info <general>: script.plex: VideoPlayerWindow: Closing
2024-07-04 20:49:22.332 T:1637     info <general>: script.plex: BGThreader: (queue.0:worker.0): Active
2024-07-04 20:49:22.332 T:1637     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/hubs/continueWatching/items?X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.334 T:1638     info <general>: script.plex: BGThreader: (queue.0:worker.1): Active
2024-07-04 20:49:22.334 T:1638     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/hubs/home/recentlyAdded?type=1&X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.335 T:1639     info <general>: script.plex: BGThreader: (queue.0:worker.2): Active
2024-07-04 20:49:22.336 T:1639     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/hubs/home/recentlyAdded?type=2&X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.336 T:1507     info <general>: script.plex: Notification: xbmc Player.OnStop {"end":false,"item":{"episode":1,"season":1,"showtitle":"Pseudo Harem","title":"ē‰©čŖžć®å§‹ć¾ć‚Šļ¼Ÿ","type":"episode"}}
2024-07-04 20:49:22.417 T:1638     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/library/sections/10/all?viewCount>=1&type=8&sort=lastViewedAt:desc&X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.422 T:1638     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/hubs/sections/15/continueWatching/items?X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.451 T:1639     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/library/sections/15/all?type=4&sort=originallyAvailableAt:desc&X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.466 T:1639     info <general>: script.plex: Hub tv.recentlyaired.15 updated - refreshing section: 'Anime-Premiere'
2024-07-04 20:49:22.466 T:1639     info <general>: script.plex: HUB: tv.recentlyaired.15 [tv.recentlyaired](10, None)
2024-07-04 20:49:22.530 T:1639     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/hubs/home/recentlyAdded?type=2&sectionID=15&X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.533 T:1639     info <general>: script.plex: Hub tv.recentlyadded.15 updated - refreshing section: 'Anime-Premiere'
2024-07-04 20:49:22.533 T:1639     info <general>: script.plex: HUB: tv.recentlyadded.15 [tv.recentlyadded](0, None)
2024-07-04 20:49:22.533 T:1639     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/library/sections/15/all?type=2&viewedOrInProgressLeafCount=0&X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.548 T:1639     info <general>: script.plex: Hub tv.startwatching.15 updated - refreshing section: 'Anime-Premiere'
2024-07-04 20:49:22.548 T:1639     info <general>: script.plex: HUB: tv.startwatching.15 [tv.startwatching](10, None)
2024-07-04 20:49:22.562 T:1639     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/library/sections/15/all?type=2&lastViewedAt<=-6w&lastViewedAt>=-5y&unwatchedLeaves=1&viewCount>=1&X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.579 T:1638     info <general>: script.plex: Hub tv.inprogress.15 updated - refreshing section: 'Anime-Premiere'
2024-07-04 20:49:22.580 T:1638     info <general>: script.plex: HUB: tv.inprogress.15 [tv.inprogress](2, None)
2024-07-04 20:49:22.580 T:1638     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/library/sections/15/all?type=2&unwatchedLeaves=1&genre=9217&X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.630 T:1638     info <general>: script.plex: Hub tv.moreingenre.15 updated - refreshing section: 'Anime-Premiere'
2024-07-04 20:49:22.630 T:1638     info <general>: script.plex: HUB: tv.moreingenre.15 [tv.moreingenre](10, None)
2024-07-04 20:49:22.638 T:1638     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/library/sections/15/all?type=2&unwatchedLeaves=1&audienceRating>=7.0&sort=audienceRating:desc&X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.652 T:1638     info <general>: script.plex: Hub tv.toprated.15 updated - refreshing section: 'Anime-Premiere'
2024-07-04 20:49:22.652 T:1638     info <general>: script.plex: HUB: tv.toprated.15 [tv.toprated](10, None)
2024-07-04 20:49:22.653 T:1638     info <general>: script.plex: API: GET https://192-168-5-205.7267e5b37cd04f37ba9ee5cdcbab1a65.plex.direct:32400/library/sections/15/all?sort=lastViewedAt:desc&unwatched=0&viewOffset=0&type=4&X-Plex-Token=****&X-Plex-Container-Start=0&X-Plex-Container-Size=10
2024-07-04 20:49:22.676 T:1639     info <general>: script.plex: Hub tv.rediscover.15 updated - refreshing section: 'Anime-Premiere'
2024-07-04 20:49:22.676 T:1639     info <general>: script.plex: HUB: tv.rediscover.15 [tv.rediscover](3, None)
2024-07-04 20:49:22.676 T:1639     info <general>: script.plex: BGThreader (queue.0:worker.2): Idle
2024-07-04 20:49:22.810 T:1638     info <general>: script.plex: Hub tv.recentlyviewed.15 updated - refreshing section: 'Anime-Premiere'
2024-07-04 20:49:22.810 T:1638     info <general>: script.plex: HUB: tv.recentlyviewed.15 [tv.recentlyviewed](10, None)
2024-07-04 20:49:22.813 T:1638     info <general>: script.plex: BGThreader (queue.0:worker.1): Idle
2024-07-04 20:49:23.386 T:1637     info <general>: script.plex: BGThreader (queue.0:worker.0): Idle

Can you create a ticket on github, please? I’ll likely need further information and don’t want to clog the thread up :slight_smile:

Edit: Aaaah I think I got it. You started the episode by pressing play on the TV Show screen, not the episode screen. And yeah, can confirm, after exiting the player and trying the same thing again, the play button doesn’t do anything. Noted, thank you!

Let me get the next beta out with the huge core changes, then I’ll tackle some of the last bugs.

First of all GOOD JOB!!! @panni

Then i want to share that i wanted to start a separate spinoff of that mod with more modern theme (a la current plex apps modern theme)…

So far i have modified only details screens But i think is not so bad…

Here is preview…

My aim is to not be so customizable but to be with modern style aligned to Plex actual style (with some differences ofcource)…

7 Likes

Nice!

Wait a couple of days until the next 0.7.9 beta.

You’ll be able to fully customize PM4K and you’ll even be able to release your own custom theme to the public, without having to fork anything.

And I’ve adapted the new (button) themes to all views, not just the video player.

I’ll also add a wiki entry as to how the new templating engine works.

3 Likes

Cool! However will it be possible to extend the python libraries too? Since my mod requires it. I have added extensions for movie editions, image bluring and so on…
Without that there is no chance to achieve that view…

Custom blurring shouldn’t be an issue I guess, and for the other extensions: If they make sense in a generic way, I’m certainly open to pull requests.

But let’s talk when we’re there. Maybe open up a Discussion on the Github repo surrounding custom theming/extensions.

Edit: I’d prefer not to have a fork of a fork to be honest :smiley:

Edit 2: I mean, a dynamic python library loader isn’t out of the question, either, if it’s really necessary.

Just did some tests - it’s not as easy as prepending sys.path with userdata/addon_data/script.plexmod/lib (probably due to the fact that Kodi uses RestrictedPython).

What works, though, python 3.4 and up:

from kodi_six import xbmc, xbmcvfs, xbmcaddon

import importlib.machinery
import importlib.util

# Import mymodule
loader = importlib.machinery.SourceFileLoader( 'testoverride', os.path.join(xbmcvfs.translatePath(xbmcaddon.Addon().getAddonInfo('profile')), "lib", "testoverride.py"))
spec = importlib.util.spec_from_loader( 'testoverride', loader )
testoverride = importlib.util.module_from_spec(spec)
loader.exec_module(testoverride)

testoverride.bobo()

So I could either build a custom importer, or I could simply let you create a ā€œmoduleoverrides.pyā€, that modifies PM4K’s code on the fly, monkeypatch-style.

Maybe there’s other options, I’ll investigate.

Edit: Yeah, that’ll probably work, as in:

from kodi_six import xbmc, xbmcvfs, xbmcaddon
import os
import sys
import importlib.machinery
import importlib.util

# Import mymodule
loader = importlib.machinery.SourceFileLoader( 'testoverride', os.path.join(xbmcvfs.translatePath(xbmcaddon.Addon().getAddonInfo('profile')), "lib", "testoverride.py"))
spec = importlib.util.spec_from_loader( 'testoverride', loader )
testoverride = importlib.util.module_from_spec(spec)
loader.exec_module(testoverride)

sys.modules['lib.windows.home'] = testoverride

– just tested:

script.plex: ERROR: 
    Traceback (most recent call last):
      File "C:\Users\panni\Kodi_21\portable_data\addons\script.plexmod\lib\main.py", line 167, in _main
        windowutils.HOME = home.HomeWindow.create()
    AttributeError: module 'testoverride' has no attribute 'HomeWindow'

Which is perfect. I’ll keep that branch and will iterate on it later.

Edit 2: So I could look for any files existing in that external lib folder and load them dynamically, overriding anything PM4K’s original source does.

For anyone curious, 0.7.9-beta11 WIP on github. Sorry panni if Im spoiling anything, but I really wanted to highlight how freaking awesome your work is! Thanks a billion times, again.

2 Likes

Leaker! Burn him/her for linking public information! :partying_face:

4 Likes

The currently pushed version (not released here yet) is usable and stable, I’m trying to make unwatched/watched indicators more dynamic (theme/settings-based without having to duplicate XML markup; adding the new black/white watched indicators as a new default), and a couple of cleanup tasks.

We’ll see how far I get on the weekend, expect a beta soon. And at lot of testing will be required by you guys :slight_smile: (massive rewrites included)

Edit: Oh yeah, and a lot of CoreELEC-related workarounds. Not excited. Kodi != CoreELEC Kodi more often than not, unfortunately.

Edit 2: corrections

6 Likes

I’m going to wait for the beta although I was tempted. As a CoreELEC user myself, it’s disappointing that you’re running into problems with it. Tbh, I’m realising that I’m not the most observant user but I think I’ve seen the judder after skip issue.