mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-13 21:56:11 +00:00
Fix error for playback report
Take into account TypeError (nonetype), depending on the player used, it might not return a result.
This commit is contained in:
parent
6849c22414
commit
a0347ce03d
1 changed files with 6 additions and 6 deletions
|
@ -134,17 +134,17 @@ class Player( xbmc.Player ):
|
||||||
|
|
||||||
try: # Audio tracks
|
try: # Audio tracks
|
||||||
indexAudio = result['currentaudiostream']['index']
|
indexAudio = result['currentaudiostream']['index']
|
||||||
except KeyError:
|
except (KeyError, TypeError):
|
||||||
indexAudio = 0
|
indexAudio = 0
|
||||||
|
|
||||||
try: # Subtitles tracks
|
try: # Subtitles tracks
|
||||||
indexSubs = result['currentsubtitle']['index']
|
indexSubs = result['currentsubtitle']['index']
|
||||||
except KeyError:
|
except (KeyError, TypeError):
|
||||||
indexSubs = 0
|
indexSubs = 0
|
||||||
|
|
||||||
try: # If subtitles are enabled
|
try: # If subtitles are enabled
|
||||||
subsEnabled = result['subtitleenabled']
|
subsEnabled = result['subtitleenabled']
|
||||||
except KeyError:
|
except (KeyError, TypeError):
|
||||||
subsEnabled = ""
|
subsEnabled = ""
|
||||||
|
|
||||||
# Postdata for the audio
|
# Postdata for the audio
|
||||||
|
@ -276,17 +276,17 @@ class Player( xbmc.Player ):
|
||||||
|
|
||||||
try: # Audio tracks
|
try: # Audio tracks
|
||||||
indexAudio = result['currentaudiostream']['index']
|
indexAudio = result['currentaudiostream']['index']
|
||||||
except KeyError:
|
except (KeyError, TypeError):
|
||||||
indexAudio = 0
|
indexAudio = 0
|
||||||
|
|
||||||
try: # Subtitles tracks
|
try: # Subtitles tracks
|
||||||
indexSubs = result['currentsubtitle']['index']
|
indexSubs = result['currentsubtitle']['index']
|
||||||
except KeyError:
|
except (KeyError, TypeError):
|
||||||
indexSubs = 0
|
indexSubs = 0
|
||||||
|
|
||||||
try: # If subtitles are enabled
|
try: # If subtitles are enabled
|
||||||
subsEnabled = result['subtitleenabled']
|
subsEnabled = result['subtitleenabled']
|
||||||
except KeyError:
|
except (KeyError, TypeError):
|
||||||
subsEnabled = ""
|
subsEnabled = ""
|
||||||
|
|
||||||
# Postdata for the audio
|
# Postdata for the audio
|
||||||
|
|
Loading…
Reference in a new issue