Skip to content

Commit

Permalink
Merge pull request #605 from MoojMidge/master
Browse files Browse the repository at this point in the history
v7.0.3.2
  • Loading branch information
MoojMidge authored Feb 28, 2024
2 parents 1392a9d + e738f7c commit 9624d86
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.youtube" name="YouTube" version="7.0.3.1" provider-name="anxdpanic, bromix">
<addon id="plugin.video.youtube" name="YouTube" version="7.0.3.2" provider-name="anxdpanic, bromix">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.requests" version="2.12.4"/>
Expand Down
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v7.0.3.2
### Fixed
- Fix settings not being saved and setup wizard repeatedly activating in Kodi 20 and lower #604
- Fix plugin refresh on settings change

## v7.0.3.1
### Fixed
- Restore support for old format plugin urls used for trailers #598
Expand Down
1 change: 0 additions & 1 deletion resources/lib/youtube_plugin/kodion/script_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def _config_actions(action, *_args):

if action == 'youtube':
xbmcaddon.Addon().openSettings()
xbmc.executebuiltin('Container.Refresh')

elif action == 'isa':
if context.use_inputstream_adaptive():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class AbstractSettings(object):

_echo = False
_cache = {}
_check_set = True
_type = None

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ def __init__(self, xbmc_addon):

self.flush(xbmc_addon)

if current_system_version.compatible(20, 0):
if current_system_version.compatible(21, 0):
_class = xbmcaddon.Settings

# set methods in new Settings class are documented as returning a
# bool, True if value was set, False otherwise, similar to how the
# old set setting methods of the Addon class function. Except they
# don't actually return anything...
# Ignore return value until bug is fixed in Kodi
XbmcPluginSettings._check_set = False

self.__dict__.update({
'_get_bool': _class.getBool,
'_set_bool': _class.setBool,
Expand Down Expand Up @@ -61,7 +68,7 @@ def _set_string_list(store, setting, value):
def flush(cls, xbmc_addon):
cls._echo = get_kodi_setting('debug.showloginfo')
cls._cache = {}
if current_system_version.compatible(20, 0):
if current_system_version.compatible(21, 0):
cls._type = xbmc_addon.getSettings
else:
cls._type = xbmcaddon.Addon
Expand Down Expand Up @@ -97,9 +104,10 @@ def get_bool(self, setting, default=None, echo=None):
def set_bool(self, setting, value, echo=None):
try:
error = not self._set_bool(self._type(), setting, value)
if error:
if error and self._check_set:
error = 'failed'
else:
error = False
self._cache[setting] = value
except (RuntimeError, TypeError) as exc:
error = exc
Expand Down Expand Up @@ -145,9 +153,10 @@ def get_int(self, setting, default=-1, process=None, echo=None):
def set_int(self, setting, value, echo=None):
try:
error = not self._set_int(self._type(), setting, value)
if error:
if error and self._check_set:
error = 'failed'
else:
error = False
self._cache[setting] = value
except (RuntimeError, TypeError) as exc:
error = exc
Expand Down Expand Up @@ -191,9 +200,10 @@ def get_string(self, setting, default='', echo=None):
def set_string(self, setting, value, echo=None):
try:
error = not self._set_str(self._type(), setting, value)
if error:
if error and self._check_set:
error = 'failed'
else:
error = False
self._cache[setting] = value
except (RuntimeError, TypeError) as exc:
error = exc
Expand Down Expand Up @@ -239,9 +249,10 @@ def get_string_list(self, setting, default=None, echo=None):
def set_string_list(self, setting, value, echo=None):
try:
error = not self._set_str_list(self._type(), setting, value)
if error:
if error and self._check_set:
error = 'failed'
else:
error = False
self._cache[setting] = value
except (RuntimeError, TypeError) as exc:
error = exc
Expand Down
4 changes: 4 additions & 0 deletions resources/lib/youtube_plugin/kodion/utils/service_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def onNotification(self, sender, method, data):

def onSettingsChanged(self):
self._settings.flush(xbmcaddon.Addon(ADDON_ID))
if xbmc.getInfoLabel('Container.FolderPath').startswith(
'plugin://{0}/'.format(ADDON_ID)
):
xbmc.executebuiltin('Container.Refresh')

data = {
'use_httpd': (self._settings.use_mpd_videos()
Expand Down

1 comment on commit 9624d86

@DjDiabolik
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this version can be proposed also on @anxdpanic repository for "normal" and "unofficial" version ?

Please sign in to comment.