Skip to content

Commit

Permalink
Misc tidy ups
Browse files Browse the repository at this point in the history
  • Loading branch information
MoojMidge committed Sep 3, 2024
1 parent ae97f89 commit e800d19
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions resources/lib/youtube_plugin/kodion/abstract_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 6 additions & 5 deletions resources/lib/youtube_plugin/youtube/helper/yt_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()):
Expand All @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e800d19

Please sign in to comment.