small fix for transocde url having duplicate params

This commit is contained in:
faush01
2020-06-29 14:04:50 +10:00
parent 21a5a260e7
commit 6b9f709092
2 changed files with 10 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.embycon"
name="EmbyCon"
version="1.9.96"
version="1.9.97"
provider-name="Team B">
<requires>
<import addon="xbmc.python" version="2.25.0"/>

View File

@@ -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