Convert parameters to int if they are not None

This commit is contained in:
Lumenol 2020-05-30 21:16:03 +02:00 committed by GitHub
parent 4e34537c5f
commit 84f111843c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,6 +155,10 @@ class Player(xbmc.Player):
LOG.info("-->[ play/%s ] %s", item['Id'], item) LOG.info("-->[ play/%s ] %s", item['Id'], item)
def set_audio_subs(self, audio=None, subtitle=None): def set_audio_subs(self, audio=None, subtitle=None):
if audio:
audio=int(audio)
if subtitle:
subtitle=int(subtitle)
''' Only for after playback started ''' Only for after playback started
''' '''
@ -169,7 +173,7 @@ class Player(xbmc.Player):
if audio and len(self.getAvailableAudioStreams()) > 1: if audio and len(self.getAvailableAudioStreams()) > 1:
self.setAudioStream(audio - 1) self.setAudioStream(audio - 1)
if subtitle == -1 or subtitle is None: if subtitle is None or subtitle == -1:
self.showSubtitles(False) self.showSubtitles(False)
return return