Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare KodiWrapper locally when using reuselanguageinvoker #574

Closed
wants to merge 1 commit into from

Conversation

mediaminister
Copy link
Collaborator

@mediaminister mediaminister commented Nov 13, 2019

This makes sure all KodiWrapper functions are executed instantaneous and return fresh values when using reuselanguageinvoker

This fixes #560

This makes realtime toggling the "watching activity" setting possible. (Should also work for all other settings)

@michaelarnauts
Copy link
Contributor

I've had a similar issue in VTM GO, since the Kodi wrapper is actually only initialised once, the old settings that are read in the first init call are being used. Therefore, you need to read the setting every time instead of using the cached value.

@michaelarnauts
Copy link
Contributor

Hmm, just looked at it, and this doesn't seem to be the case. Ignore my comment :)

@mediaminister mediaminister force-pushed the local branch 2 times, most recently from c24cd1c to 9810c19 Compare November 14, 2019 08:00
@mediaminister
Copy link
Collaborator Author

Thanks for reporting. If VTM GO add-on is not affected, there might be a cleaner fix for this problem.

@mediaminister mediaminister force-pushed the local branch 3 times, most recently from 0aa6f56 to bbfeba6 Compare November 14, 2019 10:35
@mediaminister mediaminister added the bug Something isn't working label Nov 14, 2019
@mediaminister mediaminister added this to the v2.3.0 milestone Nov 14, 2019
@mediaminister mediaminister marked this pull request as ready for review November 14, 2019 20:40
@dagwieers
Copy link
Collaborator

If we would instantiate in addon_entry.py and then pass it on, would that not help?

Personally I would use a global variable rather than a KodiWrapper object that we have to pass on.
The object is always needed anyway, so I don't see a good reason not to define it as global.

And then kodiwrapper.py would just hold a list of functions (something that would be more portable than what we currently have).

@dagwieers
Copy link
Collaborator

@mediaminister The actual fix is in #575, the problem is that the settings seems to be read only when Addon() is instantiated, which means you don't see any updates to the settings for a reused Addon() instance.

@mediaminister mediaminister deleted the local branch November 24, 2019 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changes to settings do not take effect immediately
3 participants