The usual combination of a zero-based index and a lazy if...
Also, there is no reason to use the default subtitles after asking users which subtitles they want.
It's a zero based index, so if the first entry is not the default language, you can't ever select it.
Probably related to https://github.com/jellyfin/jellyfin-kodi/issues/265
PS: It's my first time messing with code on github. Sorry, if I didn't follow protocol correctly.
* fix bug where subtitle streams that don't support external streaming
would show up in video player OSD selection as external when transcoding
(e.g. embedded PGSSUB)
* fix bug where EnableSubtitleExtraction server setting wasn't taken
into consideration when transcoding
Kodi 18 seems to not log LOGINFO messages, this approach uses LOGNOTICE if its
available and LOGINFO otherwise, ensuring compatibility without needing to
check for kodi versions
KODI recenly deprecated LOGNOTICE (as per
https://github.com/xbmc/xbmc/pull/18346) and announced that LOGINFO should be
used instead.
LOGINFO has been available since kodi matrix's migration to spdlog in april
2020.
* Override VideoBitrate option in transcoding url (previously calced in backend)
* Use manual AudioBitrate when user has track selection dialog disabled
* Fix bad loop-and-remove
* Redo max. bitrate options, add more bitrates in the lower end
* Remove SD/HD from the bitrate strings as the quality doesn't match up to what the backend selects (e.g. 1.3 Mbps definitely wasn't HD)
* Add option to force transcode mpeg2
* Add option to choose between h264 & h265 as a preferred codec for transcoding
* Add option to select preferred audio codec for transcoding/directstream
* Add option to select audio bitrate when transcoding (previously hardcoded to 384kbps for >2.0ch & 192kbps for <=2.0ch)
* Add option to select max audio channels (e.g. for server-side downmix)
* Add option to hide embedded/internal & picture-based subtitles in the track selection dialog
* Capitalize language in the track title
* Capitalize channel layout in the track title (e.g. 'Stereo')
* Remove track index from the title - users generally don't care what
the # is
* Use commercial names for the audio codecs (e.g. 'Dolby Digital'
instead of 'ac3')
* Always show codec name for subtitle tracks
and dialog line1 to message parameter rename.
The isPassword change likely bumps minimum version up to Kodi 18.
This can be worked around if desirable.
json.dumps is a processing intensive operation. This is being called
every time data is received from the server (most noticeably during
library updates) for debug logging. If the user has debug logging
disabled (the default option) then the user is still paying for
processing which is discarded.
The fix is to add a level of indirection where the dumps function is
only called if a string representation of the json is requested; ie.
when the debug string is evaluated.