diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index 813839779..4b21880e5 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -59,9 +59,9 @@ jobs: version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) xmlstarlet ed -L -P \ -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \ - -u '/addon/@version' -v "${version}" \ + -u '/addon/@version' -v "${version}+nexus.1" \ addon.xml - filename=${{ github.event.repository.name }}-${version}.zip + filename=${{ github.event.repository.name }}-${version}.nexus.1.zip cd .. zip -r $filename ${{ github.event.repository.name }} mv .git ${{ github.event.repository.name }} @@ -85,9 +85,9 @@ jobs: version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) xmlstarlet ed -L -P \ -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \ - -u '/addon/@version' -v "${version}+unofficial.1" \ + -u '/addon/@version' -v "${version}+nexus.unofficial.1" \ addon.xml - filename=${{ github.event.repository.name }}-${version}.unofficial.1.zip + filename=${{ github.event.repository.name }}-${version}.nexus.unofficial.1.zip cd .. zip -r $filename ${{ github.event.repository.name }} mv .git ${{ github.event.repository.name }} diff --git a/.github/workflows/submit-release.yml b/.github/workflows/submit-release.yml index df66d6467..4fc105bfb 100644 --- a/.github/workflows/submit-release.yml +++ b/.github/workflows/submit-release.yml @@ -52,9 +52,12 @@ jobs: git add . git commit -m "Remove Unwanted Files" news=$(awk '/^## /{rel_num++} {if(rel_num==2){exit} if(rel_num==1){print}}' changelog.txt | sed -E 's/ ?#[[:digit:]]+[., ]?//;s/\r//') - xmlstarlet ed -L -P -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" addon.xml + xmlstarlet ed -L -P \ + -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \ + -u '/addon/@version' -v "${version}+nexus.1" \ + addon.xml git add . - git commit -m "Update news" + git commit -m "Update news and repository identifier" working-directory: ${{ github.event.repository.name }} - name: Submit to Official Repository (Nexus) @@ -80,14 +83,18 @@ jobs: git add . git commit -m "Remove Unwanted Files" news=$(awk '/^## /{rel_num++} {if(rel_num==2){exit} if(rel_num==1){print}}' changelog.txt | sed -E 's/ ?#[[:digit:]]+[., ]?//;s/\r//') - xmlstarlet ed -L -P -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" addon.xml + xmlstarlet ed -L -P \ + -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \ + addon.xml git add . git commit -m "Update news" version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) - xmlstarlet ed -L -P -u '/addon/@version' -v "${version}+matrix.1" addon.xml - xmlstarlet ed -L -P -u '/addon/requires/import[@addon="xbmc.python"]/@version' -v '3.0.0' addon.xml - xmlstarlet ed -L -P -u '/addon/requires/import[@addon="inputstream.adaptive"]/@version' -v '19.0.0' addon.xml - xmlstarlet ed -L -P -d '/addon/requires/import[@addon="script.module.infotagger"]' addon.xml + xmlstarlet ed -L -P \ + -u '/addon/@version' -v "${version}+matrix.1" \ + -u '/addon/requires/import[@addon="xbmc.python"]/@version' -v '3.0.0' \ + -u '/addon/requires/import[@addon="inputstream.adaptive"]/@version' -v '19.0.0' \ + -d '/addon/requires/import[@addon="script.module.infotagger"]' \ + addon.xml git add . git commit -m "Kodi 19 Patch" working-directory: ${{ github.event.repository.name }} diff --git a/addon.xml b/addon.xml index c0926108e..7e724c820 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/changelog.txt b/changelog.txt index 6c506e8a9..7a544fb63 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,15 @@ +## v7.0.4 +### Fixed +- Fix issues with Profiler running without timer when debug logging was enabled +- Fix additional Python 2 unicode handling issues when accessing My Subscription #639 + + ### Changed + - Only set combined cache size to 20 MB in Setup Wizard if value is not already larger + - Cached playlist items will be forced to reload when deleting item from playlist rather than waiting 5 minutes + + ### New + - Make colours used for extra details in video listings customisable in Kodi 20+ + ## v7.0.4+beta.2 ### Fixed - Overhaul of http server settings to try and fix #633 diff --git a/resources/language/resource.language.en_au/strings.po b/resources/language/resource.language.en_au/strings.po index bd26e055d..cccfa5102 100644 --- a/resources/language/resource.language.en_au/strings.po +++ b/resources/language/resource.language.en_au/strings.po @@ -1470,5 +1470,17 @@ msgid "4K/60 fps, HDR, using AV1 | Fire TV Cube Gen 3, Fire TV Stick 4K Max, Ver msgstr "" 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 "" + +msgctxt "#30793" +msgid "Views count display colour" +msgstr "" + +msgctxt "#30794" +msgid "Likes count display colour" +msgstr "" + +msgctxt "#30795" +msgid "Comments count display colour" msgstr "" diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 9513e9d15..0c43f0fe2 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1470,5 +1470,17 @@ msgid "4K/60 fps, HDR, using AV1 | Fire TV Cube Gen 3, Fire TV Stick 4K Max, Ver msgstr "" 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 "" + +msgctxt "#30793" +msgid "Views count display colour" +msgstr "" + +msgctxt "#30794" +msgid "Likes count display colour" +msgstr "" + +msgctxt "#30795" +msgid "Comments count display colour" msgstr "" diff --git a/resources/language/resource.language.en_nz/strings.po b/resources/language/resource.language.en_nz/strings.po index 017ac8151..680169667 100644 --- a/resources/language/resource.language.en_nz/strings.po +++ b/resources/language/resource.language.en_nz/strings.po @@ -1470,5 +1470,17 @@ msgid "4K/60 fps, HDR, using AV1 | Fire TV Cube Gen 3, Fire TV Stick 4K Max, Ver msgstr "" 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 "" + +msgctxt "#30793" +msgid "Views count display colour" +msgstr "" + +msgctxt "#30794" +msgid "Likes count display colour" +msgstr "" + +msgctxt "#30795" +msgid "Comments count display colour" msgstr "" diff --git a/resources/language/resource.language.en_us/strings.po b/resources/language/resource.language.en_us/strings.po index ec44c55f8..75105ebba 100644 --- a/resources/language/resource.language.en_us/strings.po +++ b/resources/language/resource.language.en_us/strings.po @@ -1471,5 +1471,17 @@ msgid "4K/60 fps, HDR, using AV1 | Fire TV Cube Gen 3, Fire TV Stick 4K Max, Ver msgstr "" 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 "" + +msgctxt "#30793" +msgid "Views count display color" +msgstr "" + +msgctxt "#30794" +msgid "Likes count display color" +msgstr "" + +msgctxt "#30795" +msgid "Comments count display color" msgstr "" diff --git a/resources/lib/youtube_plugin/kodion/constants/const_settings.py b/resources/lib/youtube_plugin/kodion/constants/const_settings.py index 155bc9769..e7f405e14 100644 --- a/resources/lib/youtube_plugin/kodion/constants/const_settings.py +++ b/resources/lib/youtube_plugin/kodion/constants/const_settings.py @@ -11,42 +11,61 @@ from __future__ import absolute_import, division, unicode_literals -THUMB_SIZE = 'kodion.thumbnail.size' # (int) -SHOW_FANART = 'kodion.fanart.show' # (bool) -SAFE_SEARCH = 'kodion.safe.search' # (int) -ITEMS_PER_PAGE = 'kodion.content.max_per_page' # (int) -SEARCH_SIZE = 'kodion.search.size' # (int) -CACHE_SIZE = 'kodion.cache.size' # (int) +SETUP_WIZARD = 'kodion.setup_wizard' # (bool) +SETUP_WIZARD_RUNS = 'kodion.setup_wizard.forced_runs' # (int) + +MPD_VIDEOS = 'kodion.mpd.videos' # (bool) +MPD_STREAM_SELECT = 'kodion.mpd.stream.select' # (int) +MPD_QUALITY_SELECTION = 'kodion.mpd.quality.selection' # (int) +MPD_STREAM_FEATURES = 'kodion.mpd.stream.features' # (list[string]) +VIDEO_QUALITY_ASK = 'kodion.video.quality.ask' # (bool) +VIDEO_QUALITY = 'kodion.video.quality' # (int) AUDIO_ONLY = 'kodion.audio_only' # (bool) -AGE_GATE = 'kodion.age.gate' # (bool) + SUBTITLE_SELECTION = 'kodion.subtitle.languages.num' # (int) SUBTITLE_DOWNLOAD = 'kodion.subtitle.download' # (bool) -SETUP_WIZARD = 'kodion.setup_wizard' # (bool) -SETUP_WIZARD_RUNS = 'kodion.setup_wizard.forced_runs' # (int) -LANGUAGE = 'youtube.language' # (str) -REGION = 'youtube.region' # (str) -LOCATION = 'youtube.location' # (str) -LOCATION_RADIUS = 'youtube.location.radius' # (int) -PLAY_COUNT_MIN_PERCENT = 'kodion.play_count.percent' # (int) -USE_LOCAL_HISTORY = 'kodion.history.local' # (bool) -USE_REMOTE_HISTORY = 'kodion.history.remote' # (bool) + +ITEMS_PER_PAGE = 'kodion.content.max_per_page' # (int) 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) +SAFE_SEARCH = 'kodion.safe.search' # (int) +AGE_GATE = 'kodion.age.gate' # (bool) +API_CONFIG_PAGE = 'youtube.api.config.page' # (bool) +API_KEY = 'youtube.api.key' # (string) +API_ID = 'youtube.api.id' # (string) +API_SECRET = 'youtube.api.secret' # (string) ALLOW_DEV_KEYS = 'youtube.allow.dev.keys' # (bool) -VIDEO_QUALITY = 'kodion.video.quality' # (int) -VIDEO_QUALITY_ASK = 'kodion.video.quality.ask' # (bool) +WATCH_LATER_PLAYLIST = 'youtube.folder.watch_later.playlist' # (str) +HISTORY_PLAYLIST = 'youtube.folder.history.playlist' # (str) + +CLIENT_SELECTION = 'youtube.client.selection' # (int) +SUPPORT_ALTERNATIVE_PLAYER = 'kodion.support.alternative_player' # (bool) +ALTERNATIVE_PLAYER_WEB_URLS = 'kodion.alternative_player.web.urls' # (bool) + USE_ISA = 'kodion.video.quality.isa' # (bool) LIVE_STREAMS = 'kodion.live_stream.selection' # (int) -MPD_VIDEOS = 'kodion.mpd.videos' # (bool) -MPD_QUALITY_SELECTION = 'kodion.mpd.quality.selection' # (int) -MPD_STREAM_FEATURES = 'kodion.mpd.stream.features' # (list[string]) -MPD_STREAM_SELECT = 'kodion.mpd.stream.select' # (int) + +USE_LOCAL_HISTORY = 'kodion.history.local' # (bool) +USE_REMOTE_HISTORY = 'kodion.history.remote' # (bool) + +SEARCH_SIZE = 'kodion.search.size' # (int) +CACHE_SIZE = 'kodion.cache.size' # (int) + +DETAILED_DESCRIPTION = 'youtube.view.description.details' # (bool) +DETAILED_LABELS = 'youtube.view.label.details' # (bool) +LABEL_COLOR = 'youtube.view.label.color' # (string) + +THUMB_SIZE = 'kodion.thumbnail.size' # (int) +SHOW_FANART = 'kodion.fanart.show' # (bool) + +LANGUAGE = 'youtube.language' # (str) +REGION = 'youtube.region' # (str) +LOCATION = 'youtube.location' # (str) +LOCATION_RADIUS = 'youtube.location.radius' # (int) + +PLAY_COUNT_MIN_PERCENT = 'kodion.play_count.percent' # (int) VERIFY_SSL = 'requests.ssl.verify' # (bool) CONNECT_TIMEOUT = 'requests.timeout.connect' # (int) @@ -55,13 +74,3 @@ HTTPD_PORT = 'kodion.http.port' # (number) HTTPD_LISTEN = 'kodion.http.listen' # (string) HTTPD_WHITELIST = 'kodion.http.ip.whitelist' # (string) - -API_CONFIG_PAGE = 'youtube.api.config.page' # (bool) -API_KEY = 'youtube.api.key' # (string) -API_ID = 'youtube.api.id' # (string) -API_SECRET = 'youtube.api.secret' # (string) - -CLIENT_SELECTION = 'youtube.client.selection' # (int) - -WATCH_LATER_PLAYLIST = 'youtube.folder.watch_later.playlist' # (str) -HISTORY_PLAYLIST = 'youtube.folder.history.playlist' # (str) diff --git a/resources/lib/youtube_plugin/kodion/context/abstract_context.py b/resources/lib/youtube_plugin/kodion/context/abstract_context.py index 9e6ba6668..4fb476040 100644 --- a/resources/lib/youtube_plugin/kodion/context/abstract_context.py +++ b/resources/lib/youtube_plugin/kodion/context/abstract_context.py @@ -43,7 +43,6 @@ class AbstractContext(object): 'play', 'prompt_for_subtitles', 'refresh', - 'refresh_container' 'resume', 'screensaver', 'strm', @@ -84,11 +83,13 @@ class AbstractContext(object): 'playlist_name', 'q', 'rating', + 'reload_path', 'search_type', 'subscription_id', 'uri', 'videoid', # deprecated 'video_id', + 'video_name', 'visitor', } diff --git a/resources/lib/youtube_plugin/kodion/debug.py b/resources/lib/youtube_plugin/kodion/debug.py index a271c251d..81002d9c8 100644 --- a/resources/lib/youtube_plugin/kodion/debug.py +++ b/resources/lib/youtube_plugin/kodion/debug.py @@ -172,7 +172,10 @@ def wrapper(*args, **kwargs): return wrapper def _create_profiler(self): - self._profiler = self._Profile(timer=self._timer) + if self._timer: + self._profiler = self._Profile(timer=self._timer) + else: + self._profiler = self._Profile() self._profiler.enable() @classmethod @@ -202,7 +205,7 @@ def get_stats(self, flush=True, reuse=False): self._Stats( self._profiler, stream=output_stream - ).strip_dirs().sort_stats('cumulative', 'time').print_stats(20) + ).strip_dirs().sort_stats('cumulative', 'time').print_stats(50) # Occurs when no stats were able to be generated from profiler except TypeError: pass diff --git a/resources/lib/youtube_plugin/kodion/items/menu_items.py b/resources/lib/youtube_plugin/kodion/items/menu_items.py index a6238b1fe..a639353d7 100644 --- a/resources/lib/youtube_plugin/kodion/items/menu_items.py +++ b/resources/lib/youtube_plugin/kodion/items/menu_items.py @@ -13,7 +13,7 @@ from ..constants import paths -def more_for_video(context, video_id, logged_in=False, refresh_container=False): +def more_for_video(context, video_id, logged_in=False, refresh=False): return ( context.localize('video.more'), 'RunPlugin({0})'.format(context.create_uri( @@ -21,7 +21,7 @@ def more_for_video(context, video_id, logged_in=False, refresh_container=False): { 'video_id': video_id, 'logged_in': logged_in, - 'refresh_container': refresh_container, + 'refresh': refresh, }, )) ) @@ -129,11 +129,13 @@ def remove_video_from_playlist(context, playlist_id, video_id, video_name): context.localize('remove'), 'RunPlugin({0})'.format(context.create_uri( ('playlist', 'remove', 'video',), - { - 'playlist_id': playlist_id, - 'video_id': video_id, - 'video_name': video_name, - }, + dict( + context.get_params(), + playlist_id=playlist_id, + video_id=video_id, + video_name=video_name, + reload_path=context.get_path(), + ), )) ) @@ -242,14 +244,14 @@ def add_my_subscriptions_filter(context, channel_name): ) -def rate_video(context, video_id, refresh_container=False): +def rate_video(context, video_id, refresh=False): return ( context.localize('video.rate'), 'RunPlugin({0})'.format(context.create_uri( ('video', 'rate',), { 'video_id': video_id, - 'refresh_container': refresh_container, + 'refresh': refresh, }, )) ) diff --git a/resources/lib/youtube_plugin/kodion/items/xbmc/xbmc_items.py b/resources/lib/youtube_plugin/kodion/items/xbmc/xbmc_items.py index d83252b9a..35bac7395 100644 --- a/resources/lib/youtube_plugin/kodion/items/xbmc/xbmc_items.py +++ b/resources/lib/youtube_plugin/kodion/items/xbmc/xbmc_items.py @@ -205,6 +205,7 @@ def video_playback_item(context, video_item, show_fanart=None): 'path': uri, 'offscreen': True, } + props = {} else: kwargs = { 'label': video_item.get_title() or video_item.get_name(), @@ -212,9 +213,9 @@ def video_playback_item(context, video_item, show_fanart=None): 'path': uri, 'offscreen': True, } - props = { - 'isPlayable': str(video_item.playable).lower(), - } + props = { + 'isPlayable': str(video_item.playable).lower(), + } if (alternative_player and settings.alternative_player_web_urls() @@ -262,6 +263,7 @@ def video_playback_item(context, video_item, show_fanart=None): list_item.setMimeType(mime_type) if is_strm: + list_item.setProperties(props) return list_item if not context.get_param('resume'): diff --git a/resources/lib/youtube_plugin/kodion/monitors/service_monitor.py b/resources/lib/youtube_plugin/kodion/monitors/service_monitor.py index fba447dff..637ca98ce 100644 --- a/resources/lib/youtube_plugin/kodion/monitors/service_monitor.py +++ b/resources/lib/youtube_plugin/kodion/monitors/service_monitor.py @@ -73,6 +73,7 @@ def onSettingsChanged(self): return if changes > 1: log_debug('onSettingsChanged: {0} changes'.format(changes)) + self._settings_changes = 0 settings = self._settings settings.flush(xbmcaddon.Addon(ADDON_ID)) diff --git a/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py b/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py index 76da42618..a317e9523 100644 --- a/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py +++ b/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py @@ -13,7 +13,7 @@ from traceback import format_stack from ..abstract_plugin import AbstractPlugin -from ...compatibility import xbmcgui, xbmcplugin +from ...compatibility import xbmcplugin from ...exceptions import KodionException from ...items import ( AudioItem, @@ -66,7 +66,7 @@ def run(self, provider, context): context.log_error('XbmcRunner.run - {exc}:\n{details}'.format( exc=exc, details=''.join(format_stack()) )) - xbmcgui.Dialog().ok("Error in ContentProvider", exc.__str__()) + ui.on_ok("Error in ContentProvider", exc.__str__()) xbmcplugin.endOfDirectory(self.handle, succeeded=False) return False diff --git a/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py b/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py index 13f65d9ff..fe39cad1e 100644 --- a/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py +++ b/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py @@ -382,3 +382,7 @@ def get_history_playlist(self): 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') diff --git a/resources/lib/youtube_plugin/kodion/ui/xbmc/xbmc_context_ui.py b/resources/lib/youtube_plugin/kodion/ui/xbmc/xbmc_context_ui.py index 5adb49e9f..fab41fb4f 100644 --- a/resources/lib/youtube_plugin/kodion/ui/xbmc/xbmc_context_ui.py +++ b/resources/lib/youtube_plugin/kodion/ui/xbmc/xbmc_context_ui.py @@ -133,6 +133,15 @@ def refresh_container(self): addon_id=ADDON_ID )) + def reload_container(self, path=None): + context = self._context + xbmc.executebuiltin('ReplaceWindow(Videos, {0})'.format( + context.create_uri( + path or context.get_path(), + dict(context.get_params(), refresh=True), + ) + )) + @staticmethod def set_property(property_id, value): property_id = '-'.join((ADDON_ID, property_id)) diff --git a/resources/lib/youtube_plugin/youtube/client/youtube.py b/resources/lib/youtube_plugin/youtube/client/youtube.py index 7dcc40471..3ebb2f263 100644 --- a/resources/lib/youtube_plugin/youtube/client/youtube.py +++ b/resources/lib/youtube_plugin/youtube/client/youtube.py @@ -1537,9 +1537,9 @@ def fetch_xml(_url, _responses): if response: response.encoding = 'utf-8' xml_data = to_unicode(response.content) + xml_data = xml_data.replace('\n', '') if not current_system_version.compatible(19, 0): xml_data = xml_data.encode('utf-8') - xml_data = xml_data.replace('\n', '') root = ET.fromstring(xml_data) diff --git a/resources/lib/youtube_plugin/youtube/helper/utils.py b/resources/lib/youtube_plugin/youtube/helper/utils.py index 273cbe385..d6a60b8de 100644 --- a/resources/lib/youtube_plugin/youtube/helper/utils.py +++ b/resources/lib/youtube_plugin/youtube/helper/utils.py @@ -29,13 +29,6 @@ ISHelper = None -__COLOR_MAP = { - 'commentCount': 'cyan', - 'favoriteCount': 'gold', - 'likeCount': 'lime', - 'viewCount': 'lightblue', -} - __RE_PLAYLIST_MATCH = re.compile( r'^(/channel/(?P[^/]+))/playlist/(?P[^/]+)/?$' ) @@ -65,6 +58,7 @@ def get_thumb_timestamp(minutes=15): def make_comment_item(context, snippet, uri, total_replies=0): + settings = context.get_settings() ui = context.get_ui() author = ui.bold(snippet['authorDisplayName']) @@ -76,7 +70,7 @@ def make_comment_item(context, snippet, uri, total_replies=0): like_count = snippet['likeCount'] if 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)) plot_likes = ui.color(color, ui.bold(' '.join(( like_count, context.localize('video.comments.likes') @@ -86,7 +80,7 @@ def make_comment_item(context, snippet, uri, total_replies=0): if 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)) plot_replies = ui.color(color, ui.bold(' '.join(( total_replies, context.localize('video.comments.replies') @@ -471,7 +465,7 @@ def update_video_infos(provider, context, video_id_dict, if not value: continue - color = __COLOR_MAP.get(stat, 'white') + color = settings.get_label_color(stat) label = context.localize(label) if value == 1: label = label.rstrip('s') @@ -680,14 +674,13 @@ def update_video_infos(provider, context, video_id_dict, ) # more... - refresh_container = path.startswith((paths.LIKED_VIDEOS, - paths.DISLIKED_VIDEOS)) + refresh = path.startswith((paths.LIKED_VIDEOS, paths.DISLIKED_VIDEOS)) context_menu.extend(( menu_items.more_for_video( context, video_id, logged_in=logged_in, - refresh_container=refresh_container, + refresh=refresh, ), menu_items.play_with_subtitles( context, video_id diff --git a/resources/lib/youtube_plugin/youtube/helper/yt_playlist.py b/resources/lib/youtube_plugin/youtube/helper/yt_playlist.py index 14a6c7bd2..11db64bbc 100644 --- a/resources/lib/youtube_plugin/youtube/helper/yt_playlist.py +++ b/resources/lib/youtube_plugin/youtube/helper/yt_playlist.py @@ -69,9 +69,10 @@ def _process_remove_video(provider, context): listitem_title = context.get_listitem_detail('Title', attr=True) keymap_action = False - playlist_id = context.get_param('playlist_id', '') - video_id = context.get_param('video_id', '') - video_name = context.get_param('video_name', '') + params = context.get_params() + playlist_id = params.pop('playlist_id', '') + video_id = params.pop('video_id', '') + video_name = params.pop('video_name', '') # keymap support if (not playlist_id and not video_id and listitem_playlist_id @@ -103,7 +104,8 @@ def _process_remove_video(provider, context): if not success: return False - context.get_ui().refresh_container() + path = params.pop('reload_path', None) + context.get_ui().reload_container(path) context.get_ui().show_notification( message=context.localize('playlist.removed_from'), diff --git a/resources/lib/youtube_plugin/youtube/helper/yt_setup_wizard.py b/resources/lib/youtube_plugin/youtube/helper/yt_setup_wizard.py index 347adde71..2ca351a9a 100644 --- a/resources/lib/youtube_plugin/youtube/helper/yt_setup_wizard.py +++ b/resources/lib/youtube_plugin/youtube/helper/yt_setup_wizard.py @@ -324,7 +324,8 @@ def process_default_settings(_provider, context, step, steps): settings.live_stream_type(2) if not xbmcvfs.exists('special://profile/playercorefactory.xml'): settings.alternative_player_web_urls(False) - settings.cache_size(20) + if settings.cache_size() < 20: + settings.cache_size(20) if settings.use_isa() and not httpd_status(): settings.httpd_listen('0.0.0.0') return step diff --git a/resources/lib/youtube_plugin/youtube/helper/yt_video.py b/resources/lib/youtube_plugin/youtube/helper/yt_video.py index 2085d11e3..9154a1f54 100644 --- a/resources/lib/youtube_plugin/youtube/helper/yt_video.py +++ b/resources/lib/youtube_plugin/youtube/helper/yt_video.py @@ -70,7 +70,7 @@ def _process_rate_video(provider, context, re_match): elif response.get('status_code') == 204: # this will be set if we are in the 'Liked Video' playlist - if context.get_param('refresh_container'): + if context.get_param('refresh'): context.get_ui().refresh_container() if result == 'none': @@ -104,7 +104,7 @@ def _process_more_for_video(context): menu_items.content_from_description(context, video_id), menu_items.rate_video(context, video_id, - params.get('refresh_container')), + params.get('refresh')), ] if params.get('logged_in') else [ menu_items.related_videos(context, video_id), menu_items.video_comments(context, video_id), diff --git a/resources/settings.xml b/resources/settings.xml index f82058bc1..6f5144152 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -704,6 +704,54 @@ true + + 0 + ffadd8e6 + + + String.StartsWith(System.BuildVersionShort,1) + + + + true + true + + + + + + + 0 + ff00ff00 + + + String.StartsWith(System.BuildVersionShort,1) + + + + true + true + + + + + + + 0 + ff00ffff + + + String.StartsWith(System.BuildVersionShort,1) + + + + true + true + + + + + 0 1