mirror of
https://github.com/anxdpanic/plugin.video.youtube.git
synced 2025-12-06 02:30:50 -08:00
Make colours used for video/comment detail labels user configurable
This commit is contained in:
parent
de051883d8
commit
4d1c665b4c
8 changed files with 105 additions and 10 deletions
|
|
@ -1472,3 +1472,15 @@ msgstr ""
|
||||||
msgctxt "#30792"
|
msgctxt "#30792"
|
||||||
msgid "8K/60 fps, HDR, using AV1 | Modern device or PC with full capabilities "
|
msgid "8K/60 fps, HDR, using AV1 | Modern device or PC with full capabilities "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30793"
|
||||||
|
msgid "Views count display colour"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30794"
|
||||||
|
msgid "Likes count display colour"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30795"
|
||||||
|
msgid "Comments count display colour"
|
||||||
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1472,3 +1472,15 @@ msgstr ""
|
||||||
msgctxt "#30792"
|
msgctxt "#30792"
|
||||||
msgid "8K/60 fps, HDR, using AV1 | Modern device or PC with full capabilities "
|
msgid "8K/60 fps, HDR, using AV1 | Modern device or PC with full capabilities "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30793"
|
||||||
|
msgid "Views count display colour"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30794"
|
||||||
|
msgid "Likes count display colour"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30795"
|
||||||
|
msgid "Comments count display colour"
|
||||||
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1472,3 +1472,15 @@ msgstr ""
|
||||||
msgctxt "#30792"
|
msgctxt "#30792"
|
||||||
msgid "8K/60 fps, HDR, using AV1 | Modern device or PC with full capabilities "
|
msgid "8K/60 fps, HDR, using AV1 | Modern device or PC with full capabilities "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30793"
|
||||||
|
msgid "Views count display colour"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30794"
|
||||||
|
msgid "Likes count display colour"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30795"
|
||||||
|
msgid "Comments count display colour"
|
||||||
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1473,3 +1473,15 @@ msgstr ""
|
||||||
msgctxt "#30792"
|
msgctxt "#30792"
|
||||||
msgid "8K/60 fps, HDR, using AV1 | Modern device or PC with full capabilities "
|
msgid "8K/60 fps, HDR, using AV1 | Modern device or PC with full capabilities "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30793"
|
||||||
|
msgid "Views count display color"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30794"
|
||||||
|
msgid "Likes count display color"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30795"
|
||||||
|
msgid "Comments count display color"
|
||||||
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ SUBTITLE_SELECTION = 'kodion.subtitle.languages.num' # (int)
|
||||||
SUBTITLE_DOWNLOAD = 'kodion.subtitle.download' # (bool)
|
SUBTITLE_DOWNLOAD = 'kodion.subtitle.download' # (bool)
|
||||||
SETUP_WIZARD = 'kodion.setup_wizard' # (bool)
|
SETUP_WIZARD = 'kodion.setup_wizard' # (bool)
|
||||||
SETUP_WIZARD_RUNS = 'kodion.setup_wizard.forced_runs' # (int)
|
SETUP_WIZARD_RUNS = 'kodion.setup_wizard.forced_runs' # (int)
|
||||||
|
LABEL_COLOR = 'youtube.view.label.color' # (string)
|
||||||
LANGUAGE = 'youtube.language' # (str)
|
LANGUAGE = 'youtube.language' # (str)
|
||||||
REGION = 'youtube.region' # (str)
|
REGION = 'youtube.region' # (str)
|
||||||
LOCATION = 'youtube.location' # (str)
|
LOCATION = 'youtube.location' # (str)
|
||||||
|
|
|
||||||
|
|
@ -382,3 +382,7 @@ class AbstractSettings(object):
|
||||||
|
|
||||||
def set_history_playlist(self, value):
|
def set_history_playlist(self, value):
|
||||||
return self.set_string(settings.HISTORY_PLAYLIST, 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')
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@ except ImportError:
|
||||||
ISHelper = None
|
ISHelper = None
|
||||||
|
|
||||||
|
|
||||||
__COLOR_MAP = {
|
|
||||||
'commentCount': 'cyan',
|
|
||||||
'favoriteCount': 'gold',
|
|
||||||
'likeCount': 'lime',
|
|
||||||
'viewCount': 'lightblue',
|
|
||||||
}
|
|
||||||
|
|
||||||
__RE_PLAYLIST_MATCH = re.compile(
|
__RE_PLAYLIST_MATCH = re.compile(
|
||||||
r'^(/channel/(?P<channel_id>[^/]+))/playlist/(?P<playlist_id>[^/]+)/?$'
|
r'^(/channel/(?P<channel_id>[^/]+))/playlist/(?P<playlist_id>[^/]+)/?$'
|
||||||
)
|
)
|
||||||
|
|
@ -65,6 +58,7 @@ def get_thumb_timestamp(minutes=15):
|
||||||
|
|
||||||
|
|
||||||
def make_comment_item(context, snippet, uri, total_replies=0):
|
def make_comment_item(context, snippet, uri, total_replies=0):
|
||||||
|
settings = context.get_settings()
|
||||||
ui = context.get_ui()
|
ui = context.get_ui()
|
||||||
|
|
||||||
author = ui.bold(snippet['authorDisplayName'])
|
author = ui.bold(snippet['authorDisplayName'])
|
||||||
|
|
@ -76,7 +70,7 @@ def make_comment_item(context, snippet, uri, total_replies=0):
|
||||||
like_count = snippet['likeCount']
|
like_count = snippet['likeCount']
|
||||||
if like_count:
|
if like_count:
|
||||||
like_count = friendly_number(like_count)
|
like_count = friendly_number(like_count)
|
||||||
color = __COLOR_MAP['likeCount']
|
color = settings.get_label_color('likeCount')
|
||||||
label_likes = ui.color(color, ui.bold(like_count))
|
label_likes = ui.color(color, ui.bold(like_count))
|
||||||
plot_likes = ui.color(color, ui.bold(' '.join((
|
plot_likes = ui.color(color, ui.bold(' '.join((
|
||||||
like_count, context.localize('video.comments.likes')
|
like_count, context.localize('video.comments.likes')
|
||||||
|
|
@ -86,7 +80,7 @@ def make_comment_item(context, snippet, uri, total_replies=0):
|
||||||
|
|
||||||
if total_replies:
|
if total_replies:
|
||||||
total_replies = friendly_number(total_replies)
|
total_replies = friendly_number(total_replies)
|
||||||
color = __COLOR_MAP['commentCount']
|
color = settings.get_label_color('commentCount')
|
||||||
label_replies = ui.color(color, ui.bold(total_replies))
|
label_replies = ui.color(color, ui.bold(total_replies))
|
||||||
plot_replies = ui.color(color, ui.bold(' '.join((
|
plot_replies = ui.color(color, ui.bold(' '.join((
|
||||||
total_replies, context.localize('video.comments.replies')
|
total_replies, context.localize('video.comments.replies')
|
||||||
|
|
@ -471,7 +465,7 @@ def update_video_infos(provider, context, video_id_dict,
|
||||||
if not value:
|
if not value:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
color = __COLOR_MAP.get(stat, 'white')
|
color = settings.get_label_color(stat)
|
||||||
label = context.localize(label)
|
label = context.localize(label)
|
||||||
if value == 1:
|
if value == 1:
|
||||||
label = label.rstrip('s')
|
label = label.rstrip('s')
|
||||||
|
|
|
||||||
|
|
@ -704,6 +704,54 @@
|
||||||
<default>true</default>
|
<default>true</default>
|
||||||
<control type="toggle"/>
|
<control type="toggle"/>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting id="youtube.view.label.color.viewCount" type="string" parent="youtube.view.label.details" label="30793" help="">
|
||||||
|
<level>0</level>
|
||||||
|
<default>ffadd8e6</default>
|
||||||
|
<dependencies>
|
||||||
|
<dependency type="visible">
|
||||||
|
<condition on="property" name="infobool" operator="!is">String.StartsWith(System.BuildVersionShort,1)</condition>
|
||||||
|
</dependency>
|
||||||
|
<dependency type="enable">
|
||||||
|
<or>
|
||||||
|
<condition setting="youtube.view.description.details" operator="is">true</condition>
|
||||||
|
<condition setting="youtube.view.label.details" operator="is">true</condition>
|
||||||
|
</or>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<control type="colorbutton"/>
|
||||||
|
</setting>
|
||||||
|
<setting id="youtube.view.label.color.likeCount" type="string" parent="youtube.view.label.details" label="30794" help="">
|
||||||
|
<level>0</level>
|
||||||
|
<default>ff00ff00</default>
|
||||||
|
<dependencies>
|
||||||
|
<dependency type="visible">
|
||||||
|
<condition on="property" name="infobool" operator="!is">String.StartsWith(System.BuildVersionShort,1)</condition>
|
||||||
|
</dependency>
|
||||||
|
<dependency type="enable">
|
||||||
|
<or>
|
||||||
|
<condition setting="youtube.view.description.details" operator="is">true</condition>
|
||||||
|
<condition setting="youtube.view.label.details" operator="is">true</condition>
|
||||||
|
</or>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<control type="colorbutton"/>
|
||||||
|
</setting>
|
||||||
|
<setting id="youtube.view.label.color.commentCount" type="string" parent="youtube.view.label.details" label="30795" help="">
|
||||||
|
<level>0</level>
|
||||||
|
<default>ff00ffff</default>
|
||||||
|
<dependencies>
|
||||||
|
<dependency type="visible">
|
||||||
|
<condition on="property" name="infobool" operator="!is">String.StartsWith(System.BuildVersionShort,1)</condition>
|
||||||
|
</dependency>
|
||||||
|
<dependency type="enable">
|
||||||
|
<or>
|
||||||
|
<condition setting="youtube.view.description.details" operator="is">true</condition>
|
||||||
|
<condition setting="youtube.view.label.details" operator="is">true</condition>
|
||||||
|
</or>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<control type="colorbutton"/>
|
||||||
|
</setting>
|
||||||
<setting id="kodion.thumbnail.size" type="integer" label="30591" help="">
|
<setting id="kodion.thumbnail.size" type="integer" label="30591" help="">
|
||||||
<level>0</level>
|
<level>0</level>
|
||||||
<default>1</default>
|
<default>1</default>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue