mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Simplify conditional into switch-like form
This commit is contained in:
parent
5e188e63dd
commit
5b1e4c7eab
1 changed files with 5 additions and 7 deletions
|
@ -255,19 +255,17 @@ class Monitor(xbmc.Monitor):
|
||||||
if command in ('Mute', 'Unmute', 'SetVolume',
|
if command in ('Mute', 'Unmute', 'SetVolume',
|
||||||
'SetSubtitleStreamIndex', 'SetAudioStreamIndex', 'SetRepeatMode'):
|
'SetSubtitleStreamIndex', 'SetAudioStreamIndex', 'SetRepeatMode'):
|
||||||
|
|
||||||
if command == 'Mute':
|
if command in ['Mute', 'Unmute']:
|
||||||
xbmc.executebuiltin('Mute')
|
xbmc.executebuiltin('Mute')
|
||||||
elif command == 'Unmute':
|
|
||||||
xbmc.executebuiltin('Mute')
|
|
||||||
elif command == 'SetVolume':
|
|
||||||
xbmc.executebuiltin('SetVolume(%s[,showvolumebar])' % args['Volume'])
|
|
||||||
elif command == 'SetRepeatMode':
|
|
||||||
xbmc.executebuiltin('xbmc.PlayerControl(%s)' % args['RepeatMode'])
|
|
||||||
elif command == 'SetAudioStreamIndex':
|
elif command == 'SetAudioStreamIndex':
|
||||||
self.player.set_audio_subs(args['Index'])
|
self.player.set_audio_subs(args['Index'])
|
||||||
|
elif command == 'SetRepeatMode':
|
||||||
|
xbmc.executebuiltin('xbmc.PlayerControl(%s)' % args['RepeatMode'])
|
||||||
elif command == 'SetSubtitleStreamIndex':
|
elif command == 'SetSubtitleStreamIndex':
|
||||||
self.player.set_audio_subs(None, args['Index'])
|
self.player.set_audio_subs(None, args['Index'])
|
||||||
|
|
||||||
|
elif command == 'SetVolume':
|
||||||
|
xbmc.executebuiltin('SetVolume(%s[,showvolumebar])' % args['Volume'])
|
||||||
# Kodi needs a bit of time to update it's current status
|
# Kodi needs a bit of time to update it's current status
|
||||||
xbmc.sleep(500)
|
xbmc.sleep(500)
|
||||||
self.player.report_playback()
|
self.player.report_playback()
|
||||||
|
|
Loading…
Reference in a new issue