Closed original-birdman closed 2 years ago
As I see on OpenVix the MovieSelection code is similar to OpnePLi so you need to use a plugin from branch openpli which does not use function override.
Not sure what you mean by "use a plugin from branch openpli".
Anyway, this code doesn't work.
Are you a checked on ATV for which a branch master has been created? Check all branches of this plugin. As I write on OpenVIX you need to use branch openpli: https://github.com/Taapat/enigma2-plugin-blurayplayer/tree/openpli
The PR I'm submitting makes this one work on OpenVix (and should be simpler everywhere) so that intercepting the MovieSelection works.
There is no need for types.MethodType()
.
Also read the very important part about when two plugins both wish to override MovieSelection
.
This is not working with the OpenVix Python3 version.
The problem is that when
gotFilename
gets toself.orig_gotFilename()
theself
is an unsubstantiated instance of theMovieSelection
class, so doesn't contain any attributes (callingtype(
) on it shows it to be atype
not aclass ...MovieSelection
).In fact there is no need to use
types.MethodType()
at all. Just putting a function (defined as a method, so withself
as the first parameter) into a class makes it a callable method.However, there is a further problem, caused by making
orig_gotFilename
(andorig_itemSelectedCheckTimeshiftCallback
) methods.If I rename an original
method
asorig_method
and make it a new method in the object then if some other module comes along also wishing to intercept that method and does so by the same renaming then the whole thing falls over as that module will get mymethod
as itsorig_method
and when I callorig_method
I'll be calling myself (which Python will detect after ~1000 recursions).So the original intercepted methods must be kept as private variables in the code and called as functions using
orig_method(self, ...)
.I do have fixed code that does this, and will submit a PR shortly.