From 6b9f709092a718a9c24e7cea5a7e51b9f72b5f08 Mon Sep 17 00:00:00 2001 From: faush01 Date: Mon, 29 Jun 2020 14:04:50 +1000 Subject: [PATCH] small fix for transocde url having duplicate params --- addon.xml | 2 +- resources/lib/utils.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/addon.xml b/addon.xml index 2f86224..95d4931 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 248889b..c91f781 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -114,20 +114,23 @@ class PlayUtils: # remove the audio and subtitle indexes # this will be replaced by user selection dialogs in Kodi + params_to_remove = ["AudioStreamIndex", "SubtitleStreamIndex", "AudioBitrate"] + reduced_params = [] for param in params: - if "AudioStreamIndex" in param or "SubtitleStreamIndex" in param or "AudioBitrate" in param: - params.remove(param) + param_bits = param.split("=") + if param_bits[0] not in params_to_remove: + reduced_params.append(param) audio_playback_bitrate = addon_settings.getSetting("audio_playback_bitrate") audio_bitrate = int(audio_playback_bitrate) * 1000 - params.append("AudioBitrate=%s" % audio_bitrate) + reduced_params.append("AudioBitrate=%s" % audio_bitrate) playback_max_width = addon_settings.getSetting("playback_max_width") - params.append("MaxWidth=%s" % playback_max_width) + reduced_params.append("MaxWidth=%s" % playback_max_width) - log.debug("Streaming Params After : {0}", params) + log.debug("Streaming Params After : {0}", reduced_params) - new_url_params = "&".join(params) + new_url_params = "&".join(reduced_params) transcode_stream_path = server + "/emby" + url_path + "?" + new_url_params