Skip to content

Commit

Permalink
Add setting to disable label details
Browse files Browse the repository at this point in the history
- Close #559
  • Loading branch information
MoojMidge committed Feb 22, 2024
1 parent d2512e4 commit df2bd9c
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_au/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -1392,3 +1392,7 @@ msgstr ""
msgctxt "#30772"
msgid "Disable all framerate hinting"
msgstr ""

msgctxt "#30773"
msgid "Show video details in video lists"
msgstr ""
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -1392,3 +1392,7 @@ msgstr ""
msgctxt "#30772"
msgid "Disable all framerate hinting"
msgstr ""

msgctxt "#30773"
msgid "Show video details in video lists"
msgstr ""
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_nz/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -1388,3 +1388,7 @@ msgstr ""
msgctxt "#30772"
msgid "Disable all framerate hinting"
msgstr ""

msgctxt "#30773"
msgid "Show video details in video lists"
msgstr ""
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_us/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -1393,3 +1393,7 @@ msgstr ""
msgctxt "#30772"
msgid "Disable all framerate hinting"
msgstr ""

msgctxt "#30773"
msgid "Show video details in video lists"
msgstr ""
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
USE_REMOTE_HISTORY = 'kodion.history.remote' # (bool)
HIDE_SHORT_VIDEOS = 'youtube.hide_shorts' # (bool)
DETAILED_DESCRIPTION = 'youtube.view.description.details' # (bool)
DETAILED_LABELS = 'youtube.view.label.details' # (bool)

SUPPORT_ALTERNATIVE_PLAYER = 'kodion.support.alternative_player' # (bool)
ALTERNATIVE_PLAYER_WEB_URLS = 'kodion.alternative_player.web.urls' # (bool)
Expand Down
16 changes: 16 additions & 0 deletions resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,17 +417,26 @@ def set_content(self, content_type, sub_type=None, category_label=None):
category_label = self.get_param('category_label')
if category_label:
xbmcplugin.setPluginCategory(self._plugin_handle, category_label)
detailed_labels = self.get_settings().show_detailed_labels()
if sub_type == 'history':
self.add_sort_method(
(sort.LASTPLAYED, '%T \u2022 %P', '%D | %J'),
(sort.PLAYCOUNT, '%T \u2022 %P', '%D | %J'),
(sort.UNSORTED, '%T \u2022 %P', '%D | %J'),
(sort.LABEL_IGNORE_THE, '%T \u2022 %P', '%D | %J'),
) if detailed_labels else self.add_sort_method(
(sort.LASTPLAYED,),
(sort.PLAYCOUNT,),
(sort.UNSORTED,),
(sort.LABEL_IGNORE_THE,),
)
else:
self.add_sort_method(
(sort.UNSORTED, '%T \u2022 %P', '%D | %J'),
(sort.LABEL_IGNORE_THE, '%T \u2022 %P', '%D | %J'),
) if detailed_labels else self.add_sort_method(
(sort.UNSORTED,),
(sort.LABEL_IGNORE_THE,),
)
if content_type == content.VIDEO_CONTENT:
self.add_sort_method(
Expand All @@ -437,6 +446,13 @@ def set_content(self, content_type, sub_type=None, category_label=None):
(sort.DATEADDED, '%T \u2022 %P | %D', '%a'),
(sort.VIDEO_RUNTIME, '%T \u2022 %P | %J', '%D'),
(sort.TRACKNUM, '[%N. ]%T \u2022 %P', '%D | %J'),
) if detailed_labels else self.add_sort_method(
(sort.PROGRAM_COUNT,),
(sort.VIDEO_RATING,),
(sort.DATE,),
(sort.DATEADDED,),
(sort.VIDEO_RUNTIME,),
(sort.TRACKNUM,),
)

def add_sort_method(self, *sort_methods):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ def client_selection(self):
def show_detailed_description(self):
return self.get_bool(settings.DETAILED_DESCRIPTION, True)

def show_detailed_labels(self):
return self.get_bool(settings.DETAILED_LABELS, True)

def get_language(self):
return self.get_string(settings.LANGUAGE, 'en_US').replace('_', '-')

Expand Down
5 changes: 5 additions & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,11 @@
<default>true</default>
<control type="toggle"/>
</setting>
<setting id="youtube.view.label.details" type="boolean" label="30773" help="">
<level>0</level>
<default>true</default>
<control type="toggle"/>
</setting>
</group>
<group id="2">
<setting id="kodion.history.local" type="boolean" label="30675" help="">
Expand Down

0 comments on commit df2bd9c

Please sign in to comment.