Try to reduce log spam in Kodi versions <20 due to unsupported colorbutton control in settings

- Introduced after 4d1c665
- Probably won't achieve anything
- Related #668
This commit is contained in:
MoojMidge 2024-04-01 02:00:03 +11:00
parent b42d260adc
commit 0d86842057

View file

@ -13,7 +13,7 @@ from __future__ import absolute_import, division, unicode_literals
import sys
from ..constants import settings
from ..utils import validate_ip_address
from ..utils import current_system_version, validate_ip_address
class AbstractSettings(object):
@ -383,6 +383,17 @@ class AbstractSettings(object):
def set_history_playlist(self, value):
return self.set_string(settings.HISTORY_PLAYLIST, value)
def get_label_color(self, label_part):
setting_name = '.'.join((settings.LABEL_COLOR, label_part))
return self.get_string(setting_name, 'white')
if current_system_version.compatible(20, 0):
def get_label_color(self, label_part):
setting_name = '.'.join((settings.LABEL_COLOR, label_part))
return self.get_string(setting_name, 'white')
else:
_COLOR_MAP = {
'commentCount': 'cyan',
'favoriteCount': 'gold',
'likeCount': 'lime',
'viewCount': 'lightblue',
}
def get_label_color(self, label_part):
return self._COLOR_MAP.get(label_part, 'white')