From e800d190bd41978bc6d3f504585e8081e4706710 Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Wed, 4 Sep 2024 06:45:06 +1000 Subject: [PATCH] Misc tidy ups --- .../lib/youtube_plugin/kodion/abstract_provider.py | 8 ++++---- .../lib/youtube_plugin/youtube/helper/yt_play.py | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/resources/lib/youtube_plugin/kodion/abstract_provider.py b/resources/lib/youtube_plugin/kodion/abstract_provider.py index a19f72517..e9789d074 100644 --- a/resources/lib/youtube_plugin/kodion/abstract_provider.py +++ b/resources/lib/youtube_plugin/kodion/abstract_provider.py @@ -269,9 +269,9 @@ def reroute(self, context, path=None, params=None, uri=None): except Exception as exc: context.log_error('Rerouting error: |{0}|'.format(exc)) finally: - context.log_debug('Rerouting to |{path}| |{params}|{status}' - .format(path=path, - params=params, + uri = context.create_uri(path, params) + context.log_debug('Rerouting to |{uri}|{status}' + .format(uri=uri, status='' if result else ' failed')) if not result: return False @@ -284,7 +284,7 @@ def reroute(self, context, path=None, params=None, uri=None): context.execute(''.join(( 'ActivateWindow(Videos, ', - context.create_uri(path, params), + uri, ', return)' if window_return else ')', ))) return True diff --git a/resources/lib/youtube_plugin/youtube/helper/yt_play.py b/resources/lib/youtube_plugin/youtube/helper/yt_play.py index ced804a4a..aa36ab792 100644 --- a/resources/lib/youtube_plugin/youtube/helper/yt_play.py +++ b/resources/lib/youtube_plugin/youtube/helper/yt_play.py @@ -52,6 +52,7 @@ def _play_stream(provider, context): incognito = params.get('incognito', False) screensaver = params.get('screensaver', False) + audio_only = False is_external = ui.get_property(PLAY_WITH) if ((is_external and settings.alternative_player_web_urls()) or settings.default_player_web_urls()): @@ -62,11 +63,10 @@ def _play_stream(provider, context): ask_for_quality = settings.ask_for_video_quality() if ui.pop_property(PLAY_PROMPT_QUALITY) and not screensaver: ask_for_quality = True - audio_only = False + elif ui.pop_property(PLAY_FORCE_AUDIO): + audio_only = True else: audio_only = settings.audio_only() - if ui.pop_property(PLAY_FORCE_AUDIO): - audio_only = True try: streams = client.get_streams(context, @@ -312,8 +312,9 @@ def process(provider, context, **_kwargs): params = context.get_params() param_keys = params.keys() - if ({'channel_id', 'playlist_id', 'playlist_ids', 'video_id'} - .isdisjoint(param_keys)): + if {'channel_id', 'playlist_id', 'playlist_ids', 'video_id'}.isdisjoint( + param_keys + ): listitem_path = context.get_listitem_info('FileNameAndPath') if context.is_plugin_path(listitem_path, PATHS.PLAY): video_id = find_video_id(listitem_path)